This server was generated by the swagger-codegen project. By using the OpenAPI-Spec from a remote server, you can easily generate a server stub. This is an example of building a swagger-enabled Flask server.
This example uses the Connexion library on top of Flask.
Python 3.5.2+
To run the server, please execute the following from the root directory:
pip3 install -r requirements.txt
# start a mock server by default
python3 -m unicorn_server
# you can specify a controller as backend
python3 -m unicorn_server -B kytos
and open your browser to here:
http://localhost:9000/v1/unicorn/ui/
Your Swagger definition lives here:
http://localhost:9000/v1/unicorn/swagger.json
To launch the integration tests, use tox:
sudo pip install tox
tox
To run the server on a Docker container, please execute the following from the root directory:
# building the image
docker build -t unicorn_server .
# starting up a container
docker run -p 9000:9000 unicorn_server
If you modified the api specification, you can run make
from the root
directory to regenerate the model files:
# run make directly will download swagger-codegen to .bin
make
# or you can specify the exec path of your existing swagger-codegen to void
# downloading the binary of swagger-codegen
SWAGGER_EXEC=swagger-codegen make