Skip to main content

swagger2sphinx

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.

Metadata

Release files for sphinxcontrib-swagger2sphinx 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for sphinxcontrib-swagger2sphinx 0.1.4
File Interpreter ABI Platform
sphinxcontrib_swagger2sphinx-0.1.4-py3-none-any.whl Python 3 none any Details

Release files / sphinxcontrib_swagger2sphinx-0.1.4-py3-none-any.whl

Download URL sphinxcontrib_swagger2sphinx-0.1.4-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c3695d569db096a6af390f7e1711085d1764b12cd1579edabb7bdd54337c948
BLAKE2b-256 checksum
How to use checksums
4b4186e8b8f0a2b41c68426af483a9388b6b13de1abe584ef7b9d619060258c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for sphinxcontrib-swagger2sphinx 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page