This sample project demonstrates how to use a Swagger specification to generate a Jupyter notebook. The generated notebook is then consumed by the Jupyter Kernel Gateway and is turned into a REST microservice.
Located in jupyter-swagger-codegen
a java project for generating notebooks from a swagger specification can be found. For information, see the README in that directory.
There is a sample notebook, with supplemental files, in the swagger-petstore-service
folder. This notebook can be packaged and run in a docker container:
cd swagger-petstore-service
# build the docker container
./package.sh
# run the docker container
./run.sh
This service can be accessed from the swagger editor. To get the editor to correctly interact with the API:
- Copy the contents of
SwaggerPetstoreSpec.yaml
cat swagger-petstore-service/SwaggerPetstoreSpec.yaml | pbcopy
- Go to http://editor.swagger.io and paste the contents into the editor
- Modify the
host
property in the document to point to theip:port
of your docker container