Switch branches/tags
Nothing to show
Find file History
Latest commit fc8ae2f Dec 18, 2015


Swagger to Notebook to Microservice

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.

Swagger Codegen Module

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.

Swagger Pet Store Implementation

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

# run the docker container

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 the ip:port of your docker container