Convert OpenAPI 3.0 to Swagger 2.0

99封情书 提交于 2020-01-24 03:51:26

问题


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.


回答1:


  • LucyBot api-spec-converter (online version, GitHub repo, Node.js module) can convert from OpenAPI 3.0 to 2.0.

  • API Transformer also claims to be able to convert OpenAPI 3.0 back to OpenAPI 2.0. There's a command-line version too.

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



来源:https://stackoverflow.com/questions/56637299/convert-openapi-3-0-to-swagger-2-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!