PyPI |
|
Linux |
Windows |
![TravisCI](https://camo.githubusercontent.com/1881479e0852a8c9699a74df6f2c127e909f51be4f75ada186928a018ab2940c/68747470733a2f2f7472617669732d63692e6f72672f6d726b2d616e64726565762f746f726e61646f2d737761676765722e7376673f6272616e63683d6d6173746572) |
|
tornado-swagger: Swagger API Documentation builder for tornado server.
Inspired
byaiohttp-swaggerpackage
(based on this package sources).
- ::
- # manaul install
pip install .
- ::
- pip install -U tornado-swagger
tornado-swagger is a plugin for tornado server that allow to document
APIs using Swagger show the Swagger-ui console ( default url /api/doc).
![image8](https://github.com/mrk-andreev/tornado-swagger/raw/master/docs/wiki__swagger_single_endpoint.png?raw=true)
import tornado.web
from tornado_swagger.model import register_swagger_model
from tornado_swagger.parameter import register_swagger_parameter
class PostsDetailsHandler(tornado.web.RequestHandler):
def get(self, posts_id):
"""
---
tags:
- Posts
summary: Get posts details
description: posts full version
produces:
- application/json
parameters:
- $ref: '#/parameters/PostId'
responses:
200:
description: list of posts
schema:
$ref: '#/definitions/PostModel'
"""
@register_swagger_parameter
class PostId:
"""
---
name: posts_id
in: path
description: ID of post
required: true
type: string
"""
@register_swagger_model
class PostModel:
"""
---
type: object
description: Post model representation
properties:
id:
type: integer
format: int64
title:
type: string
text:
type: string
is_visible:
type: boolean
default: true
"""
- Specify supported python versions: 3.7, 3.8, 3.9, 3.10, 3.11 and nightly
- Remove flake8-eradicate, flake8-isort from dev deps
- Create make test-in-docker for test application across python versions
- Update dev requirements (fix broken packages)
- Update PyYAML from PyYAML==5.4 to PyYAML>=5.4 [issue-59](mrk-andreev/tornado-swagger#59)
- Specify encoding in tornado_swagger/setup.py::open
- Fix pypi build (migrate README from md to rst)
- Add experimental openapi support (api_definition_version =
API_OPENAPI_3; examples/model_and_param_declaration_openapi3.py)
- Fix link to spec swagger.json
issue.
- Update PyYAML version to 5.4 (Fix for CVE-2020-14343)
- Fix handler args name parsing (
examples/args_recognize.py
).
Thanks to [@reubinoff]
- Add
security
to setup. Thanks to
[@daominwang](https://github.com/daominwang)
- Add black code formatter
- Update swagger-ui library to 3.37.2
- Add integrity attribute to script / link tags
- Remove Python 3.5 support
- Add display_models param to setup (
defaultModelsExpandDepth
).
Thanks to [@Sloknatos](https://github.com/Sloknatos)
- Fix swagger-ui bundle
CVE-2019-17495
- Specify supported python versions: 3.5, 3.6, 3.7, 3.8, nightly
- Update dependencies
PyYAML==5.3.1
fix vulnerabilities
pytest==6.0.1
, pytest-flake8==1.0.6
fix test crash
- Support wrapped methods
- Remove jinja2 from deps
- Replace local js/css to cdn
- Remove static files serving
- Swagger model definition
- Parameters filling in route path
- Schema definition
export_swagger(routes)
as public function
- Update frontend
![FOSSA Status](https://camo.githubusercontent.com/820efa0386998735994075b65293d932308e62fd4baa5d3764c63e1d9097d91e/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d2532466d726b2d616e6472656576253246746f726e61646f2d737761676765722e7376673f747970653d736869656c64)