This server was generated by the OpenAPI Generator project. By using the OpenAPI-Spec from a remote server, you can easily generate a server stub. This is an example of building a OpenAPI-enabled Flask server.
This example uses the Connexion library on top of Flask.
Python 3.5.2+
To run the server on a Docker container, please execute the following from the root directory:
# building the image
docker build -t openapi_server .
# starting up a container
docker run -p 8080:8080 openapi_serverIf not using docker, to run the server, please execute the following from the root directory:
pip3 install -r requirements.txt
python3 -m openapi_server
You can use this UI to test API calls to the server.
http://localhost:8080/dsayling8/ZoomFoodToo/1.0.0/ui/
http://localhost:8080/dsayling8/ZoomFoodToo/1.0.0/openapi.json
To launch the integration tests, use tox:
sudo pip install tox
tox
You can also start up the swagger editor with the local spec file.
When you're done editing the file though, you'll have to download it from the browser and replace the zoomfood-openapi.yml in the project directory.
docker run -p 8081:8080 -v $(pwd):/tmp -e SWAGGER_FILE=/tmp/zoomfood-openapi.yaml swaggerapi/swagger-editorThe root specification zoomfood-openapi.yaml can be used to generate other code bases. Soon this spec file will have a source of truth where the generation should be done from - until then, you can generate other code bases using the OpenAPI spec prebuilt image.
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli list
Shows you want you can generate and then feed into
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
-i /local/zoomfood-openapi.yaml \
-g lang-to-generate \
-o /local/dest-dir-for-generated-code