Skip to main content

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

Project description

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

Tested with various dependency version

Tested for versions in combination:

python

django

drf-spectacular

3.8

4.0

0.25.x

3.9

4.1

0.26.x

3.10

4.2

0.27.x

3.11

5.0

Installation

Install using pip

$ pip install drf-spectacular-jsonapi

then configure the rest framework and drf-spectacular with the following settings inside your project settings.py

REST_FRAMEWORK = {
    # YOUR SETTINGS
    "DEFAULT_SCHEMA_CLASS": "drf_spectacular_jsonapi.schemas.openapi.JsonApiAutoSchema",
    "DEFAULT_PAGINATION_CLASS": "drf_spectacular_jsonapi.schemas.pagination.JsonApiPageNumberPagination",
}
SPECTACULAR_SETTINGS = {
    # To provide different schema components for patch and post
    "COMPONENT_SPLIT_REQUEST": True
    # to fix path parameter names for nested routes https://chibisov.github.io/drf-extensions/docs/#nested-routes
    "PREPROCESSING_HOOKS": [
        "drf_spectacular_jsonapi.hooks.fix_nested_path_parameters"
    ],
}

Release management

Same as the based drf-spectacular package, we provide versions below sem version 1.x.x to signal that every new version may potentially break you.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drf-spectacular-jsonapi-0.4.1.tar.gz (14.7 kB view hashes)

Uploaded Source

Built Distribution

drf_spectacular_jsonapi-0.4.1-py3-none-any.whl (13.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page