protoc-gen-connect-openapi
generates OpenAPI YAML files for Connect from Protocol Buffers definition.
protoc-gen-connect-openapi
supports OpenAPI 3.0.
-
Install and configure
buf
-
Install
protoc-gen-connect-openapi
go install github.com/s-takehana/protoc-gen-connect-openapi@latest
- Create a OpenAPI template
info:
title: Example API
version: 0.1.0
- Configure a
buf.gen.yaml
file
version: v1
plugins:
- name: connect-openapi
out: .
opt:
- template=path/to/protoc-gen-connect-openapi_template.yaml
- Execute
buf
buf generate