A demo of APIFlask to annotate a Python application to generate an OpenAPI document using the native APIFlask OpenAPI module.
- Install/verify python3.7+
$python --version$python3 --version
- Install/verify pip3
$pip --version$pip3 --version
For macOS and Linux:
$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -r requirements.txtFor Windows:
> python -m venv venv
> venv\Scripts\activate
> pip install -r requirements.txt$ deactivate
$ flask spec --format yaml --output generated_openapi.yaml
$ flask spec --format json --output generated_openapi.jsonUse flask run command to run the example application:
$ flask run
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)Note: you can view the OpenAPI document with GET /openapi