flask-restx icon indicating copy to clipboard operation
flask-restx copied to clipboard

Open API V3 Support

Open ndamclean opened this issue 4 years ago • 7 comments

flask_restplus currently outputs the swagger.json in the old "Swagger 2.0" format. Are there any plans to also support the OpenAPI 3.x specification?

OpenAPI 3.x has better support for different authentication methods, including JWT token-based authentication.

ndamclean avatar Jan 30 '20 23:01 ndamclean

This includes updating the 2 year old swagger-ui-dist

twsl avatar Feb 17 '20 12:02 twsl

Any updates on this? :-) I don't mind Swagger 2.0 myself, but I'm getting requests for OpenAPI 3.x. I'd be happy to help if needed!

Cheaterman avatar Apr 09 '20 11:04 Cheaterman

Could you at least write something about plans for OpenAPI 3 in the readme.md? Currently it does not even recognize the existence of the new major version of the format.

With no such information one could easily get a false impression that it is implemented, working fine and there is not much to talk about.

...It's not that 3.0 appeared yesterday.

sherghan avatar Sep 24 '20 14:09 sherghan

I think this is a rather serious issue. This is what refrains me from using this library...

francesco086 avatar Nov 06 '20 13:11 francesco086

I'm being requested to move to OpenAPI 3 for a rather big project, do you have any roadmap?

rawouter avatar Mar 30 '21 09:03 rawouter

I want to bring up some big points here --

  1. the logic for creating the Swagger docs are ingrained in the RestX classes. So it's a heavy lift with the current architecture to support both 2.0 and 3.0.
  2. We've had discussions of moving the modeling from the RestX specific classes to a more generalized framework: https://github.com/python-restx/flask-restx/issues/59

I completely understand the need to move to OpenAPI 3.0, but it's going to be a large lift. We welcome contributions from all over, and I'm working through some more of the backlog of open PRs and issues.

j5awry avatar Apr 14 '21 13:04 j5awry

Just out of curiosity. Is there a python library that is able to convert swagger 2.0 to openapi 3.0? If there is such library, would it make sense that flask-restx have the option to use this to switch between 2.0 and 3.0? Maybe just do this as a short term solution until the more generalized framework is done.

I know some time ago I used some converter from swagger 2.0 to openapi 3.0. A few details were not converted correctly so I stopped doing that. But don't know if it is impossible to do this conversion perfectly or was the converter that had some bug or missing features. Anyway, just throwing out an idea in case it could be useful.

mauvilsa avatar Mar 23 '22 10:03 mauvilsa