A step-by-step guide to auto-generating an OpenAPI specification from a gRPC service using the buf tool, grpc-gateway, and the openapiv2 plugin. Covers defining a proto service, generating Go server code, annotating RPC methods with HTTP routes, generating the gRPC-HTTP gateway, producing a Swagger JSON spec, and serving an interactive Swagger UI alongside the gRPC and HTTP servers.

10m read timeFrom blainsmith.com
Post cover image
Table of contents
Defining a gRPC ServiceGenerating and Implementing the Server in GoImplementing the gRPC ServerStarting the gRPC ServerAnnotate the gRPC Service with HTTP RoutesGenerate the gRPC GatewayStarting the HTTP ServerGenerating the OpenAPI SpecificationPlay the API with the Swagger UIClosing Thoughts
6 Impressions