42

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.

Grokify
  • 11,326
  • 5
  • 39
  • 59
Michal Foksa
  • 8,205
  • 5
  • 38
  • 61
  • Related: [Convert OpenAPI 2.0 to OpenAPI 3.0](https://stackoverflow.com/q/59749513/113116) – Helen Jan 15 '20 at 10:42
  • 1
    @Helen misleading link, user asked foe convert 3 to 2, you linked 2 to 3 – Reza Apr 29 '21 at 19:36
  • @Reza As you've (correctly) noted, the related link is for the _opposite conversion_, it's posted just in case some readers may need it too. I don't see what's misleading about this. – Helen May 28 '21 at 12:49
  • @Helen the question is "Convert 3 to 2" and you posted "Convert 2 to 3", usually when related is tagged under a question means it's already answered there – Reza May 28 '21 at 13:17
  • @Reza that would be "duplicate" & closed as such, not "related". You and I seem to have different definitions of "related". – Helen May 28 '21 at 20:34

1 Answers1

53

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

Helen
  • 58,317
  • 8
  • 161
  • 218