🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

flake8-flask-openapi-docstring

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flake8-flask-openapi-docstring

A Flake8 plugin to enforce OpenAPI docstrings in Flask routes

pipPyPI
Version
0.1.2
Maintainers
1

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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts