Skip to main content

A Flake8 plugin to enforce OpenAPI docstrings in Flask routes

Project description

flake8-flask-openapi-docstring

This Flake8 plugin will check if your Flask route's docstrings are valid OpenAPI spec.

Libraries like APISpec can generate OpenAPI spec from your Flask routes and docstrings and it's important to have present and in the correct format.

for example, this routes:

@app.route("/hello", methods=["GET"])
def hello():
    return "Hello World!"

will raise an error witht his plugin because not only the docstring is missing but also the OpenAPI spec is missing as well.

However these route:

@app.route("/hello", methods=["GET"])
def hello():
    """
    Returns a greeting

    ---
    get:
        responses:
            200:
    """
    return "Hello World!"

will not raise any error because the docstring is present and the OpenAPI spec is present as well.

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

flake8_flask_openapi_docstring-0.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file flake8_flask_openapi_docstring-0.1.1.tar.gz.

File metadata

File hashes

Hashes for flake8_flask_openapi_docstring-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6bc2e868fd3270ca0811cbc6eb9e79af9c8818b1bd9b814d45c57323f68ae90f
MD5 3dc04ae593cb771f7621ceb1d1af9ba8
BLAKE2b-256 f90e9172091e1bfc99b25d2e004c14b7ebacf9666eb867003156c14ba4240e5a

See more details on using hashes here.

File details

Details for the file flake8_flask_openapi_docstring-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_flask_openapi_docstring-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e213af31307c8513a3e5e80d2c8e0688106b923e034c4d286a100787a5fc072a
MD5 a9d22c6c00f2e4d5d1d20ec6ea89a894
BLAKE2b-256 5852c65feae03a6c103b62082cee26d1bc92927643e33419623475597d827815

See more details on using hashes here.

Supported by

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