I've done extensive Google searching but couldn't find a good tool to do this. The closest I could find was https://github.com/googleapis/gnostic, which allows converting an OpenAPI description (swagger.yaml) into a .pb file or a .json file. I'm wondering if there are any tools to convert this .pb file into a .proto proto3 file?
I also tried https://github.com/NYTimes/openapi2proto but unfortunately there are a few cases that aren't handled correctly.
Thanks in advance for your help!
Converting to OAS 3.0 Swagger Editor has a Convert to OpenAPI 3 option under the Edit drop-down that acts as an interface to this API. All we need to do is open our document in Swagger Editor, then convert by using Edit > Convert to OpenAPI 3.
Although the terms once referred to the same thing, they can no longer be used interchangeably…even though some people still do. In 2021, OpenAPI refers to the industry-standard specification for RESTful API design. Swagger refers to a set of SmartBear tools.
Format. An OpenAPI document that conforms to the OpenAPI Specification is itself a JSON object, which may be represented either in JSON or YAML format.
OpenAPI Specification (formerly Swagger Specification) is an API description format for REST APIs. An OpenAPI file allows you to describe your entire API, including: Available endpoints ( /users ) and operations on each endpoint ( GET /users , POST /users ) Operation parameters Input and output for each operation.
I know this question is old, but I was wandering the same and it seems that things have changed in meantime. So I will post an answer for others, lazy enough to search :)
Currently there are several options to convert OpenApi 2/3 to Protobuf:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With