Flask Swagger Documentation by Problem Fighter Library
Project description
In the name of God, the Most Gracious, the Most Merciful.
PF-Flask-Swagger
PF Flask Swagger is created from produce Swagger API Documentation very quickly and easily.
pip install Flask
- Install PF Flask Swagger
pip install -U PF-Flask-Swagger
- Create file called quickstart.py and add below codes
from flask import Flask, redirect
from marshmallow import fields
from pf_flask_swagger.swagger.pf_swagger_decorator import post_request, post_upload_request
from pf_flask_swagger.flask.pf_flask_swagger import PFFlaskSwagger
from pf_flask_rest_com.api_def import FileField, APIDef
app = Flask(__name__)
flask_swagger = PFFlaskSwagger(app)
class PersonDTO(APIDef):
first_name = fields.String(required=True, error_messages={"required": "Please enter first name"})
last_name = fields.String(allow_none=None)
email = fields.Email(required=True, error_messages={"required": "Please enter email."})
income = fields.Float(allow_none=None)
image = FileField(allow_none=None)
@app.route('/')
def bismillah():
return redirect("/pf-flask-swagger-ui")
@app.route('/post-request')
@post_request(request_obj=PersonDTO, response_list=PersonDTO)
def post_request_endpoint():
return "PF Flask Swagger POST Request"
@app.route('/post-upload-request')
@post_upload_request(request_obj=PersonDTO)
def post_upload_request():
return "PF Flask Swagger File Upload Request"
if __name__ == '__main__':
app.run()
- Now run the Flask application.
Documentation
Install and update using pip:
pip install -U PF-Flask-Swagger
Please find the Documentation with example from hmtmcse.com
Donate
Problem Fighter develops and supports PF-Flask-Swagger and the libraries it uses. In order to grow the community of contributors and users, and allow the maintainers to devote more time to the projects.
Contributing
For guidance on setting up a development environment and how to make a contribution to PF-Flask-Swagger, see the contributing guidelines.
Links
- Changes : https://opensource.problemfighter.org/flask/pf-flask-swagger
- PyPI Releases : https://pypi.org/project/pf-flask-swagger
- Source Code : https://github.com/problemfighter/pf-flask-swagger
- Issue Tracker : https://github.com/problemfighter/pf-flask-swagger/issues
- Website : https://www.problemfighter.com/open-source
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 PF-Flask-Swagger-1.0.2.tar.gz.
File metadata
- Download URL: PF-Flask-Swagger-1.0.2.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
395b38dd52e77138f8287f36f596db09a96402572eb9e6fc5a5e487754f9e718
|
|
| MD5 |
e1c8b0f633f8ba33721ac9a45e339c92
|
|
| BLAKE2b-256 |
cfd66eae22dc9a0633eb4e4e3ec9bb85f2d0480e4c485b290884db4a7b01f819
|
File details
Details for the file PF_Flask_Swagger-1.0.2-py3-none-any.whl.
File metadata
- Download URL: PF_Flask_Swagger-1.0.2-py3-none-any.whl
- Upload date:
- Size: 470.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85bbe96792eedbfc877a2343a7a8410030c75ae6dd37b24d1121deacbc5b5181
|
|
| MD5 |
bdeb6a01db42f0dd7d517321fa2ab1e0
|
|
| BLAKE2b-256 |
57b4e862c0f34699d5e3c9cb461571f4ac414e48fc33e80bb25942b5c8f57bb1
|