API Documentation - chanandrew96/MyLearning GitHub Wiki
Type | Documentation | Reference |
---|---|---|
Specification | Swagger | Flask-RESTX |
Swagger Client | ||
Tool | Swagger UI | Tool based on Swagger |
Tool | Redoc | Using OpenAPI Standard (fka Swagger) |
Tool | DapperDox | Open-Source API documentation generator and server for OpenAPI Swagger specifications |
Tool | 42Crunch | Create API Documentation based on OpenAPI with Swagger, also provided function for checking API Security |
Specification | OpenAPI | Work with WebSphere Application Server Liberty (Java) |
FaskAPI + OpenAPI |
Swagger
Work with Flask
Library | Description |
---|---|
Flask-RESTful | Create RESTful API |
Flask-RESTPlus | Added Swagger into Flask-RESTful to generate API Documentation |
Flask-RESTX | New version based / forked from Flask-RESTPlus due to lack of maintenance of Flask-RESTPlus |
Use Swagger (Flask-RESTX) with API Core
doc - Swagger route root
# Browse to http://127.0.0.1:[HOST PORT]/api/doc for Swagger doc
api = Api(app, version='0.0.1', title='Flask-RESTX and Swagger test', doc='/api/doc')
# Disable Swagger in Flask-RESTX
api = Api(app, version='0.0.1', title='Flask-RESTX and Swagger test', doc=false)
@api.doc()
decorator
Documenting with the Flask-RESTX Documentation Reference
@api.route('/my-resource/<id>', endpoint='my-resource')
@api.doc(params={'id': 'An ID'})
class MyResource(Resource):
def get(self, id):
return {}
@api.doc(responses={403: 'Not Authorized'})
def post(self, id):
api.abort(403)
OpenAPI
Generate TypeScript using OpenAPI Documentation
References
difference between Flask-RESTful and Flask-RESTx
Flask RestPlus VS flask-restx
月光下的Flask之旅系列 第 28 篇 - Day 28 Flask-RESTX
Flask 学习-46.Flask-RESTX 生成 Swagger 文档入门教程
Documenting with the decorator
Flask API Documentation using Flask-Restx (Swagger for Flask)
Setting Up Swagger 2 with a Spring REST API Using Springfox