Registry / web-framework / sphinxcontrib-httpdomain

sphinxcontrib-httpdomain

JSON →
library2.0.0pypypi✓ verified 24d ago

Sphinxcontrib-httpdomain is an active Sphinx extension (current version 2.0.0) that provides a domain for documenting RESTful HTTP APIs directly within reStructuredText or MyST documentation. It allows authors to describe HTTP resources, methods, request/response headers, query parameters, and status codes, integrating API documentation seamlessly with project documentation. Releases are made as needed, often tied to Sphinx compatibility or feature additions.

pip install sphinxcontrib-httpdomain
INSTALL
IMPORT
SIG · SPHINXCONTRIB-HTTP
S
sphinxcontrib-httpdomain
web-frameworkpythonv2.0.0
Install
5.4s avg
Import
Disk
95MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 92.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.4s · import 0.000s · 93MB
95MB installed
● package 95MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Extension Configuration
extensions = ['sphinxcontrib.httpdomain']
import sphinxcontrib.httpdomain
This is a Sphinx extension; it's enabled by adding its name to the 'extensions' list in Sphinx's conf.py, not by a Python import statement for direct use.

To use sphinxcontrib-httpdomain, first add 'sphinxcontrib.httpdomain' to the 'extensions' list in your Sphinx project's `conf.py`. Then, you can define HTTP API endpoints using directives like `.. http:get::` in your reStructuredText or MyST files, detailing paths, parameters, statuses, and examples.

Add `sphinxcontrib.httpdomain` to your `conf.py`: ```python # conf.py project = 'My API Docs' copyright = '2026, Your Name' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinxcontrib.httpdomain' ] ``` Then, in a reStructuredText file (e.g., `api.rst`): ```rst .. http:get:: /users/(int:user_id) :synopsis: Get user profile Fetches the profile for a specific user. :param user_id: The ID of the user to retrieve. :type user_id: int :status 200: User profile retrieved successfully. :status 404: User not found. **Example request**: .. sourcecode:: http GET /users/123 HTTP/1.1 Host: example.com Accept: application/json **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json { "id": 123, "name": "John Doe", "email": "john.doe@example.com" } ```
Debug
Known issues
breakingVersion 2.0.0 requires Python >=3.10. Users on older Python versions (e.g., 3.7-3.9) must upgrade their Python environment to use this version of the extension.
fix
Upgrade your Python environment to 3.10 or newer, or pin to an older `sphinxcontrib-httpdomain` version (e.g., `<2.0.0`) if Python upgrade is not feasible.
affects: >=2.0.0
deprecatedThe `mimetype` role was deprecated in version 1.3.0. Use the `http:header` role instead for referring to MIME types or HTTP headers.
fix
Replace `:mimetype:` with `:http:header:` in your documentation. For example, `:mimetype:`text/html`` becomes `:http:header:`Content-Type```.
affects: <1.3.0 (usage)
gotchaThe `http_strict_mode` configuration option's behavior changed in version 1.5.0. It no longer warns on non-standard header prefixes, potentially leading to fewer warnings than expected if strict mode was relied upon for such validation.
fix
Review your documentation and consider custom Sphinx validation if you relied on `http_strict_mode` for warnings about non-standard header prefixes.
affects: >=1.5.0
gotchaUsers have reported 'routingtable not defined' errors during parallel Sphinx builds, indicating potential issues with concurrency when building documentation with this extension.
fix
If encountering parallel build errors, try disabling parallel builds in Sphinx (e.g., `make html -j1` or setting `num_workers = 1` in `conf.py`). Monitor GitHub issues for a permanent fix.
affects: All versions (intermittent)
Upgrade
Version history
2.0.0latest on PyPI · released Feb 4, 2026
Audit
Dependencies
SphinxrequiredCore documentation generator that this library extends.
PythonrequiredRequires Python 3.10 or newer.
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
sphinxcontrib-httpdomain — pip install sphinxcontrib-httpdomain · libregistry