Convert OpenAPI 3.0 to Swagger 2.0
Asked Answered
I

3

77

Is there a generator to convert OpenAPI 3.0 to Swagger 2.0?

Mashery, an API gateway, requires Swagger 2.0 format on input to open endpoint.

Inanna answered 17/6, 2019 at 18:55 Comment(1)
Related: Convert OpenAPI 2.0 to OpenAPI 3.0Bridle
B
93

Keep in mind that OAS3→OAS2 convertion is lossy in general, because OAS3 has features that did not exist in OAS2 (such as multiple servers, oneOf/anyOf, different schemas per media type, objects in query string parameters, cookie parameters, and others).

Bridle answered 18/6, 2019 at 7:29 Comment(1)
Note that apimatic.io/transformer and the CLI "version" of apimatic.io/transformer depend on a paid account.Tolan
C
5

I needed version 2.0 for Power Automate.

When you are building some Azure Functions, try to create them in Visual Studio and enable any checkbox that is named Swagger not OpenAPI.

Now the API of your Azure Function contains the swagger.json that you can set into Power Automate Custom Connector.

Criminology answered 18/9, 2021 at 14:35 Comment(1)
Unsure this should not have been a comment, but this is good contextRapping
J
0

There is also an abandoned GitHub project https://github.com/kongchen/swagger-maven-plugin that is quite useful. We forked this project and adapted it to our needs (we have to use Google Endpoints which requires OAS 2.0)!

Jegar answered 18/7, 2023 at 16:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.