python web框架sanic的大用户界面。
sanic-simple-swagger的Python项目详细描述
- Sanic OpenAPI
这个项目只是扩展了功能并修复了一些错误 啊![示例swagger ui](https://raw.githubusercontent.com/huge-success/sanic-openapi/master/images/code-to-ui.png“swagger ui”)
#[git文档](https://github.com/FerdinaKusumah/sanic_simple_swagger)
##安装 `shell pip install sanic-simple-swagger `
####添加openapi和swagger ui: `python from sanic_simple_swagger import swagger_blueprint, openapi_blueprint app.blueprint(openapi_blueprint) app.blueprint(swagger_blueprint) `
现在,您将在url/swagger/index.html处拥有一个swagger用户界面。
你的路线将根据蓝图自动分类。
###配置所有内容
`python app.config['API_VERSION'] = '1.0.0' app.config['API_TITLE'] = 'Swagger Petstore' app.config['API_DESCRIPTION'] = 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.' app.config['API_TERMS_OF_SERVICE'] = 'http://swagger.io/terms/'app.config['API_CONTACT_EMAIL'] = 'http://swagger.io/terms/'app.config['API_LICENSE_NAME'] = 'Apache 2.0' app.config['API_LICENSE_URL'] = 'http://www.apache.org/licenses/LICENSE-2.0.html'app.config['schemes'] = ['http', 'https'] `
##参考 1。[三位一体](https://github.com/huge-success/sanic) 2.[sanic openapi](https://github.com/huge-success/sanic-openapi)