skillfed

drf-spectacular-jsonapi

open api 3 schema generator for drf-json-api package based on drf-spectacular package.

drf-spectacular-jsonapi v0.6.0 94.9K downloads/30d#13,297 on PyPI14
Permissive license BSD Active released

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-jsonapi

uv

uv add drf-spectacular-jsonapi

poetry

poetry add drf-spectacular-jsonapi

Installing 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

Development Status :: 3 - AlphaEnvironment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: DocumentationTopic :: Internet :: WWW/HTTPTopic :: Software Development :: Code GeneratorsTopic :: Software Development :: Libraries

Tags

openapi schema generator json apidrf-spectacular json apidjango rest framework json api docsopenapi 3 json api schemarest framework schema generationapi documentation json api
openapi-schemajson-apidjango-rest-framework

More Libraries packages