Converter from Swagger to Sphinx HTTP domain.
Swagger is an open specification for documenting REST APIs in JSON or YAML. Imperfect as it is, it’s de facto a standard for many API developers.
This extension lets you render your swagger.json file as a Sphinx document. It uses HTTP domain directives for paths and a glossary for definitions.
Install the extension:
$ pip install sphinxcontrib-swagger2sphinx
Copy the content of swagger-api.rst to the file where you want your Swagger file rendered.
Add the extension to your conf.py:
extensions = [ 'sphinxcontrib.swagger2sphinx', ... ]
Specify the path to your Swagger file in conf.py. It can be a local path or a URL:
swagger2sphinx_swagger_location = "swagger.json" # swagger2sphinx_swagger_location = "http://example.com/swagger.json"
Thanks to Eric Holscher for writing an excellent blog post about extending Sphinx with Jinja2 templating.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for sphinxcontrib_swagger2sphinx-0.1.4-py3-none-any.whl