Skip to content

Basic REST project with Flask , Connexion by Zalando , OpenApi3, Docker and tox

License

Notifications You must be signed in to change notification settings

kevinmmartins/python-flask-connexion-example-openapi3

Repository files navigation

Basic project with Flask, Connexion and OpenApi 3

Build Status

Basic Python project using Connexion and Flask

https://github.com/spec-first/connexion

Requirements

  • Docker Compose 1.21.2+
  • Python 3.9 +

Run with Docker Compose

# building the container
sudo docker-compose build

# starting up a container
sudo docker-compose up

Build the virtual environment

pip3 install virtualenv
virtualenv -p python3.9 venv
source venv/bin/activate
pip3 install -r requirements.txt
pip3 install -r test-requirements.txt

Launch the server

python3 -m basic

You should see output similar to this:

`ConnexionMiddleware.run` is optimized for development. For production, run using a dedicated ASGI server.
INFO:     Started server process [5753]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8081 (Press CTRL+C to quit)

Swagger definition

View the generated Swagger UI at this URL:

http://localhost:8081/v1/basic/ui/

Health Check

Check the server health at this URL:

http://localhost:8081/v1/basic/ping

Launch tests

source venv/bin/activate
pip3 install tox
tox

About

Basic REST project with Flask , Connexion by Zalando , OpenApi3, Docker and tox

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published