flake8-flask-openapi-docstring-0.1.2
توضیحات
A Flake8 plugin to enforce OpenAPI docstrings in Flask routes
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | flake8-flask-openapi-docstring-0.1.2 |
| نام | flake8-flask-openapi-docstring |
| نسخه کتابخانه | 0.1.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Daniele Esposti |
| ایمیل نویسنده | daniele.esposti@gmail.com |
| آدرس صفحه اصلی | https://github.com/expobrain/flake8-flask-openapi-docstring |
| آدرس اینترنتی | https://pypi.org/project/flake8-flask-openapi-docstring/ |
| مجوز | MIT |
# flake8-flask-openapi-docstring
This Flake8 plugin will check if your Flask route's docstrings are valid OpenAPI spec.
Libraries like [APISpec](https://apispec.readthedocs.io/en/latest/) 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:
```python
@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:
```python
@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.
نیازمندی
| مقدار | نام |
|---|---|
| >3 | apispec |
| >=5.4 | pyyaml |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<3.12 | Python |
نحوه نصب
نصب پکیج whl flake8-flask-openapi-docstring-0.1.2:
pip install flake8-flask-openapi-docstring-0.1.2.whl
نصب پکیج tar.gz flake8-flask-openapi-docstring-0.1.2:
pip install flake8-flask-openapi-docstring-0.1.2.tar.gz