drf-spectacular-jsonapi
open api 3 schema generator for drf-json-api package based on drf-spectacular package.
What it is and what it does
This package bridges drf-spectacular (a popular OpenAPI schema generator for Django REST Framework) and djangorestframework-jsonapi (which implements the JSON:API specification). It generates OpenAPI 3 schemas that correctly represent JSON:API-compliant endpoints, handling JSON:API-specific conventions like sparse fieldsets, includes, and filtering that standard schema generators don't understand.
You install it alongside your existing Django REST Framework setup, configure it as the schema class in your REST_FRAMEWORK settings, and it automatically generates accurate OpenAPI documentation for your JSON:API endpoints. It includes hooks for handling nested routes from drf-extensions and can split request schemas for PATCH and POST operations. The package is in alpha (pre-1.0) and signals that breaking changes may occur in minor version bumps.
Use it for:
- Generate interactive OpenAPI documentation (Swagger/ReDoc) for JSON:API endpoints without manual schema annotation.
- Integrate JSON:API services with API client generators that consume OpenAPI specs.
- Document nested resource routes created with drf-extensions in a way that reflects their JSON:API structure.
- Split request/response schemas for PATCH and POST operations to show different required fields per HTTP method.
- Validate that your JSON:API implementation conforms to the spec by inspecting the generated schema.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates OpenAPI 3 schemas for Django REST Framework APIs that use the JSON:API specification, extending drf-spectacular to handle JSON:API-specific conventions.
Yes, if you are already using djangorestframework-jsonapi and drf-spectacular together. It solves a real gap—standard schema generators don't understand JSON:API semantics—and has low install friction. The alpha status and small community (14 stars) mean you should expect occasional breaking changes and limited third-party troubleshooting resources, but the package is actively maintained and has no known vulnerabilities.
Install
drf-spectacular-jsonapi on PyPI
pip
pip install drf-spectacular-jsonapiuv
uv add drf-spectacular-jsonapipoetry
poetry add drf-spectacular-jsonapiInstalling drf-spectacular-jsonapi
Before you install
Low friction install with a pure-Python wheel. Actively maintained as of May 2026 with recent releases. Depends on five runtime packages (Django, drf-spectacular, drf-extensions, djangorestframework, djangorestframework-jsonapi) that you must already have configured; the documentation explicitly requires installing those first.
License in practice
BSD license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute this package freely as long as you include the license notice.
Quickstart
pip install drf-spectacular-jsonapi
# In settings.py:
REST_FRAMEWORK = {
"DEFAULT_SCHEMA_CLASS": "drf_spectacular_jsonapi.schemas.openapi.JsonApiAutoSchema",
}
SPECTACULAR_SETTINGS = {
"COMPONENT_SPLIT_REQUEST": True,
}
Requires Django, djangorestframework, djangorestframework-jsonapi, and drf-spectacular to be installed and configured first.
Verify before relying
- Whether the package works correctly with Django 5.2 and 6.0 (listed in test matrix but without explicit Python/drf-spectacular versions)
- Current state of the 14 GitHub stars and whether the package has active community adoption beyond download counts
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — Django, drf-spectacular, drf-extensions, djangorestframework, djangorestframework-jsonapi |
| Maintenance | actively maintained — 87 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 94,920/month — #13,297 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: drf_spectacular_jsonapi-0.6.0-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
drf-spectacularGenerates OpenAPI 3.0.3, 3.1, and 3.2 schemas…
permissive · top 5,000 on PyPI
djangorestframework-jsonapiAdapts Django REST framework to output…
permissive · top 15,000 on PyPI
drf-spectacular-sidecarServes pre-built Swagger UI and Redoc…
permissive · top 5,000 on PyPI
drf-standardized-errorsConverts all Django REST Framework API error…
permissive · top 15,000 on PyPI
drf-extensionsProvides mixins, decorators, and utilities that…
permissive · top 5,000 on PyPI
drf-yasgGenerates Swagger/OpenAPI 2.0 specifications…
permissive · top 5,000 on PyPI
djangorestframeworkBuilds web APIs on top of Django with…
permissive · top 1,000 on PyPI
drf-orjson-rendererProvides a high-performance JSON renderer and…
permissive · top 15,000 on PyPI
voluptuous-openapiConverts Voluptuous validation schemas into…
permissive · top 15,000 on PyPI
apispecGenerates OpenAPI specification documents from…
permissive · top 5,000 on PyPI