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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8_flask_openapi_docstring-0.1.1.tar.gz.
File metadata
- Download URL: flake8_flask_openapi_docstring-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bc2e868fd3270ca0811cbc6eb9e79af9c8818b1bd9b814d45c57323f68ae90f
|
|
| MD5 |
3dc04ae593cb771f7621ceb1d1af9ba8
|
|
| BLAKE2b-256 |
f90e9172091e1bfc99b25d2e004c14b7ebacf9666eb867003156c14ba4240e5a
|
File details
Details for the file flake8_flask_openapi_docstring-0.1.1-py3-none-any.whl.
File metadata
- Download URL: flake8_flask_openapi_docstring-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e213af31307c8513a3e5e80d2c8e0688106b923e034c4d286a100787a5fc072a
|
|
| MD5 |
a9d22c6c00f2e4d5d1d20ec6ea89a894
|
|
| BLAKE2b-256 |
5852c65feae03a6c103b62082cee26d1bc92927643e33419623475597d827815
|