Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Annotations

A demo of APIFlask to annotate a Python application to generate an OpenAPI document using the native APIFlask OpenAPI module.

Installation

  • Install/verify python3.7+
    • $python --version
    • $python3 --version
  • Install/verify pip3
    • $pip --version
    • $pip3 --version

Build the environment

For macOS and Linux:

$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -r requirements.txt

For Windows:

> python -m venv venv
> venv\Scripts\activate
> pip install -r requirements.txt

To exit the Venv

$ deactivate

Generate the Open API Specification File

$ flask spec --format yaml --output generated_openapi.yaml
$ flask spec --format json --output generated_openapi.json

Run the Flask Application

Use 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