Skip to main content

Converter from Swagger to Sphinx HTTP domain.

Project description

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.

Usage

  1. Install the extension:

    $ pip install sphinxcontrib-swagger2sphinx
  2. Copy the content of swagger-api.rst to the file where you want your Swagger file rendered.

  3. Add the extension to your conf.py:

    extensions = [
        'sphinxcontrib.swagger2sphinx',
        ...
    ]
  4. 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"

Testimonials

Thanks to Eric Holscher for writing an excellent blog post about extending Sphinx with Jinja2 templating.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinxcontrib_swagger2sphinx-0.1.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file sphinxcontrib_swagger2sphinx-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_swagger2sphinx-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 51cad160a3040b45abae7d3ef8f49bfed7666618b655ebc68e96b4edc4fda4ba
MD5 2becf96ea7499d3ab258702378779d47
BLAKE2b-256 67cd007f1df4608094348db6d20bab550a076c73133e34b1129012d53f1e16ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page