Registry / devops / drf-spectacular-jsonapi

drf-spectacular-jsonapi

JSON →
library0.6.0pypypiunverified

OpenAPI 3 schema generator for django-rest-framework-json-api, built on top of drf-spectacular. Version 0.6.0, supports Python >=3.7. It automatically generates a JSON:API compliant OpenAPI spec and uses the same configuration patterns as drf-spectacular.

pip install drf-spectacular-jsonapi
INSTALL
IMPORT
SIG · DRF-SPECTACULAR-JS
D
drf-spectacular-jsonapi
devopspythonv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

JsonApiSchemaGenerator
from drf_spectacular_jsonapi import JsonApiSchemaGenerator
from drf_spectacular_jsonapi.schema import JsonApiSchemaGenerator

Minimal example: instantiate JsonApiSchemaGenerator and get schema.

from drf_spectacular_jsonapi.schema import JsonApiSchemaGenerator # Use instead of drf-spectacular's generator in your schema view schema_view = JsonApiSchemaGenerator( title='My API', version='1.0.0', description='JSON:API compliant API' ) schema = schema_view.get_schema(request=None, public=True) print(schema)
Debug
Known issues
gotchaMust use drf-spectacular's SpectacularAPIView with 'generator_class' attribute set to JsonApiSchemaGenerator. Not doing so generates a plain drf-spectacular schema instead of JSON:API.
fix
In your urls.py: path('schema/', SpectacularAPIView.as_view(generator_class=JsonApiSchemaGenerator), name='schema')
affects: all
deprecatedPackage name is 'drf-spectacular-jsonapi' but the import path uses underscore dash: 'drf_spectacular_jsonapi'. Common mistake: try to import with dash or camelcase.
fix
Always use 'drf_spectacular_jsonapi' (underscores) in Python imports.
affects: all
gotchaRequires drf-json-api (djangorestframework-jsonapi) to be installed and configured. Without it, schema generation may fail with missing renderer/parser errors.
fix
Install: pip install djangorestframework-jsonapi and add 'rest_framework_json_api' to INSTALLED_APPS.
affects: all
gotchaThe package extends drf-spectacular's settings. Custom settings like 'SCHEMA_PATH_PREFIX' must be set via SPECTACULAR_SETTINGS dictionary, not a separate setting.
fix
Set in Django settings: SPECTACULAR_SETTINGS = {'SCHEMA_PATH_PREFIX': '/api/v1/'}
affects: all
Upgrade
Version history
0.6.0latest on PyPI · released May 19, 2026
Audit
Dependencies
djangorestframework-jsonapirequiredrequired runtime dep for JSON:API support
drf-spectacularrequiredcore dependency for schema generation
Agent activity
7 hits · last 30 days
node
6
Resources
drf-spectacular-jsonapi — pip install drf-spectacular-jsonapi · libregistry