skillfed

sphinxcontrib-openapi

OpenAPI (fka Swagger) spec renderer for Sphinx

sphinxcontrib-openapi v0.9.0 320.3K downloads/30d#7,637 on PyPI126
Permissive license BSD-3-Clause AGING released

What it is and what it does

sphinxcontrib-openapi is a Sphinx extension that converts OpenAPI (formerly Swagger) specification files into formatted API documentation. It leverages the sphinxcontrib-httpdomain extension to provide HTTP domain support, so it integrates naturally with Sphinx's documentation build pipeline. You add it to your Sphinx conf.py extensions list and then use the openapi directive to point to your spec file—typically a YAML or JSON OpenAPI definition—and it renders the endpoints, parameters, request/response schemas, and other API details into your documentation.

The package depends on Sphinx, PyYAML for parsing specs, jsonschema for validation, and a few utility libraries (picobox, deepmerge, sphinx-mdinclude) to handle configuration and schema merging. It's designed for teams that maintain OpenAPI specs and want to keep their API documentation in sync without manual rewriting.

Use it for:

  • Generate API reference documentation from an OpenAPI spec as part of your Sphinx build process.
  • Keep API docs automatically synchronized with your OpenAPI definition during development.
  • Render REST endpoint details (paths, methods, parameters, responses) into a Sphinx project.
  • Embed interactive or formatted API specifications into larger technical documentation.
  • Build a single-source documentation site where API reference comes from your spec file.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Sphinx extension that renders OpenAPI (Swagger) specifications into formatted API documentation using the HTTP domain.

Yes, if you maintain an OpenAPI spec and use Sphinx for documentation. The package is stable, permissively licensed, and has low install friction. Maintenance is aging (185 days since last release), so verify compatibility with your Sphinx version before adopting. No known security vulnerabilities.

Install

sphinxcontrib-openapi on PyPI

pip

pip install sphinxcontrib-openapi

uv

uv add sphinxcontrib-openapi

poetry

poetry add sphinxcontrib-openapi

Installing sphinxcontrib-openapi

Before you install

Low friction install with a pure Python wheel. Maintenance is aging—last release 185 days ago—but the repository remains active and the package has been stable since its 2016 release.

License in practice

BSD-3-Clause is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install sphinxcontrib-openapi

# In conf.py:
extensions = [
    'sphinxcontrib.openapi',
]

# In your .rst file:
.. openapi:: path/to/openapi.yml

Requires Python 3.10 or later.

Verify before relying

  • Whether the package handles all OpenAPI 3.0+ features or has known limitations with certain spec versions.
  • Performance characteristics when rendering large or complex OpenAPI specifications.
  • Compatibility with recent Sphinx versions beyond what the classifiers indicate.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — sphinx, sphinxcontrib-httpdomain, PyYAML, jsonschema, sphinx-mdinclude, picobox, deepmerge
Maintenance aging — 185 days since the last release
Last repo commit
First released
Downloads 320,278/month — #7,637 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sphinxcontrib_openapi-0.9.0-py3-none-any.whl

Keywords: sphinx, openapi, swagger, rest, api, renderer, docs

Environment :: ConsoleFramework :: Setuptools PluginFramework :: SphinxFramework :: Sphinx :: ExtensionIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonTopic :: DocumentationTopic :: Documentation :: Sphinx

Tags

openapi documentation generatorswagger spec to sphinx docsrest api documentation sphinxopenapi renderer sphinxgenerate api docs from openapisphinx openapi extension
api-documentationopenapisphinx-extension

More Documentation packages

docutils

Docutils converts plaintext documentation in…

unclear · top 1,000 on PyPI

Sphinx

Sphinx generates professional documentation…

permissive · top 1,000 on PyPI

griffe

Griffe extracts the complete structure and…

permissive · top 1,000 on PyPI

sphinxcontrib-serializinghtml

A Sphinx extension that outputs documentation…

permissive · top 1,000 on PyPI

alabaster

Alabaster is a clean, responsive Sphinx theme…

permissive · top 1,000 on PyPI

sphinxcontrib-htmlhelp

A Sphinx extension that generates HTML help…

permissive · top 1,000 on PyPI

sphinxcontrib-httpdomain

Provides a Sphinx domain for documenting HTTP…

permissive · top 5,000 on PyPI

sphinxcontrib-images

A Sphinx extension that replaces standard image…

permissive · top 15,000 on PyPI

sphinxcontrib-redoc

A Sphinx extension that embeds OpenAPI…

permissive · top 15,000 on PyPI

swagger-plugin-for-sphinx

A Sphinx plugin that embeds interactive Swagger…

permissive · top 5,000 on PyPI

sphinxcontrib-googleanalytics

Adds Google Analytics tracking to…

permissive · top 15,000 on PyPI

django-rest-swagger

Generates Swagger UI documentation and OpenAPI…

permissive · top 15,000 on PyPI

bravado

Bravado generates a dynamic REST client from an…

permissive · top 15,000 on PyPI

bidict

Provides a bidirectional dictionary (bidict)…

copyleft · top 1,000 on PyPI

openapi-python-client

Generates type-annotated Python HTTP clients…

permissive · top 5,000 on PyPI

drf-yasg

Generates Swagger/OpenAPI 2.0 specifications…

permissive · top 5,000 on PyPI