Demo on using Swagger UI with any codebase
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
package-lock.json Initial commit Nov 26, 2017


Demo of using Swagger UI for API documentation for any codebase without library dependencies. Here, we provide a demo using Flask and Python.

Check out my blog post for more details and explanations, especially on how to generalize this to work across different languages & frameworks.

Docker image

To save some installation effort, you can follow the instructions in this section to build and run a Docker image that has everything you need.

The following command builds a Docker image tagged swagger-demo:


To run it (you have to be in the top level of this repo):


Then go to

You can modify api-docs.yml and refresh to see the updates.


Install any version of Python 3.x using pyenv and nodejs 8.x using nvm. Details using concrete examples below.

Installation Instructions

For pyenv and npm, follow the instructions on their GitHub READMEs.

Install Python 3.6.3 using pyenv

pyenv install 3.6.3

Create virtualenv for this demo

pyenv virtualenv 3.6.3 swagger-demo

Install Flask

pyenv activate swagger-demo
pip install -r requirements.txt


pyenv activate swagger-demo

Go to to see the swagger ui. Update api-docs.yml and refresh to see the changes


All files except:

are under the MIT License, Copyright (c) 2017-2018 Pang Yan Han