Convert OpenAPI 3.0 to Swagger 2.0

OpenapiOpenapi GeneratorMashery

Openapi Problem Overview


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.

Openapi Solutions


Solution 1 - Openapi

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).

Solution 2 - Openapi

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMichal FoksaView Question on Stackoverflow
Solution 1 - OpenapiHelenView Answer on Stackoverflow
Solution 2 - Openapiniek tuytelView Answer on Stackoverflow