Is there a way to generate a RESTful API in Flask using Swagger?

有帮助吗?

解决方案 2

Flask is now supported from the Swagger Editor: http://editor.swagger.io/#/

其他提示

There is Flask-RESTPlus based on Flask-Restful until now. It provides some decorators to document your API and generate a Swagger specification, a Postman collection...

Next version will be able to generate the API from Swagger specifications.

You can also use connexion

"Connexion is a framework on top of Flask to automagically handle your REST API requests based on Swagger 2.0 Specification files in YAML."

You can use flask-restful-swagger.

Flasgger is an extension to make automatic UI for Flask routes http://github.com/rochacbruno/flasgger

If you don't use the flask-restful extension you could take a look at flask-sillywalk

Nowadays there is also flask-apispec. It uses marshmallow to write the schemas/annotations that end up in the swagger output.

For Swagger 3.0:

Use fastapi.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top