Skip to main content

Swagger API Documentation builder for tornado server

Project description

Maintainability Snyk Vulnerabilities for GitHub Repo FOSSA Status GitHub Code style: black

PyPI

PyPI

Linux

Windows

TravisCI

AppVeyor

tornado-swagger: Swagger API Documentation builder for tornado server. Inspired byaiohttp-swaggerpackage (based on this package sources).

Documentation

https://github.com/mrk-andreev/tornado-swagger/wiki

Code

https://github.com/mrk-andreev/tornado-swagger

Issues

https://github.com/mrk-andreev/tornado-swagger/issues

Python version

Python 3.7, 3.8, 3.9, 3.10, 3.11 nightly

Swagger Language Specification

https://swagger.io/specification/v2/

Installation

pip install -U tornado-swagger

What’s 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

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
    """

What’s new?

Version 1.5.0

Version 1.4.5

  • 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

Version 1.4.4

Version 1.4.3

Version 1.4.2

Version 1.4.1

  • Fix pypi build (migrate README from md to rst)

Version 1.4.0

  • Add experimental openapi support (api_definition_version = API_OPENAPI_3; examples/model_and_param_declaration_openapi3.py)

Version 1.3.0

Version 1.2.11

  • Fix link to spec swagger.json issue.

Version 1.2.10

  • Update PyYAML version to 5.4 (Fix for CVE-2020-14343)

Version 1.2.9

  • Fix handler args name parsing (examples/args_recognize.py). Thanks to [@reubinoff]

Version 1.2.8

  • 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

Version 1.2.7

  • 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

Version 1.2.6

Version 1.2.5

  • Update dependencies

    • PyYAML==5.3.1 fix vulnerabilities

    • pytest==6.0.1, pytest-flake8==1.0.6 fix test crash

Version 1.2.4

Version 1.2.3

Version 1.2.1

  • Support wrapped methods

  • Remove jinja2 from deps

Version 1.2.0

  • Replace local js/css to cdn

  • Remove static files serving

Version 1.1.0

  • Swagger model definition

  • Parameters filling in route path

  • Schema definition

  • export_swagger(routes) as public function

  • Update frontend

Version 1.0.0

  • First version released

License

FOSSA Status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tornado-swagger-1.5.0.tar.gz (13.9 kB view details)

Uploaded Source

File details

Details for the file tornado-swagger-1.5.0.tar.gz.

File metadata

  • Download URL: tornado-swagger-1.5.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for tornado-swagger-1.5.0.tar.gz
Algorithm Hash digest
SHA256 f7826d935cdd33eaa6365326726a8461912b5c69b92c3666ff02e4dcec0226a0
MD5 db53795d23aca6e69277dcfb946a8fbb
BLAKE2b-256 d5bfa7040e7ee12aa6d5401c951e94b7b83e8ebbca04e4d538238233dbd79709

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page