Skip to content

xiangq27/alto-swagger

 
 

Repository files navigation

Swagger generated server

NOTE: Check the OpenAPI specification in branch spec.

Travis status

Overview

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.

Requirements

Python 3.5.2+

Usage

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

Running with Docker

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

For Developer

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

About

Swagger API for ALTO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.0%
  • Makefile 2.0%
  • Shell 1.0%