Format conversions are a common and important operation in data analysis and data archiving.
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.
The server was generated via
docker run --rm --workdir /local -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/openapi/openapi.yaml -g python-flask -c config.yaml -o /local
Python 3.5.2+
To run the server, please execute the following from the root directory:
pip3 install -r requirements.txt
python3 -m openapi_server
and open your browser to here:
http://localhost:8080/formaTAPIRest/v1/ui/
Your OpenAPI definition lives here:
http://localhost:8080/formaTAPIRest/v1/openapi.json
Some example calls via CURL are:
curl -X POST "http://localhost:8080/formaTAPIRest/v1/convert/mzXML/to/mzML" -H "accept: application/xml:" -H "Content-Type: multipart/form-data" -F "profile=" -F "[email protected];type=application/octet-stream"
curl -X POST "http://localhost:8080/formaTAPIRest/v1/convert/mzXML/to/mzML" -H "accept: application/xml:" -H "Content-Type: multipart/form-data" -F "profile=xxx" -F "[email protected]"
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 openapi_server .
# starting up a container
docker run -p 8080:8080 openapi_server