Embed Swagger UI in Github Pages

Andrew Smithson
1 min readSep 28, 2019

--

The Open API Specification gives a standard and easy way to describe RESTful APIs such that anyone can call them or build client applications that use the APIs.

While the JSON or YAML representations might be great for machines to get done what they need, a graphical interface is definitely preferable for a person who wants to understand what the API can do, and potentially try it out.

If you’re storing your code and specification in Github, then Github pages gives you a free hosting environment in which to display something like Swagger UI which gives potential users that preferable graphical interface.

The first step is to enable Github Pages on the repo which is documented here.

Secondly add an index.html page

Commit and push the changes and in a few seconds your page will be live with the visualisation of your API available to the world.

--

--

Andrew Smithson

Software Engineer, Gamer, Musician and everything in between. All opinions are my own.