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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for drf-spectacular-jsonapi-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dfbe4e20bc66507f1f64c9497a6d277b0cc3cd573691261bb38db74e440ebac |
|
MD5 | 0420c4741d342c3bddf425424be74895 |
|
BLAKE2b-256 | b4e960b804184b718df6710e8756cf13575a967d448e1736fccd21c696c476cc |
Close
Hashes for drf_spectacular_jsonapi-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffffe5aed81c4b73f65a117c1feeadef26378eb45b58bc9c2875e35bfa84118a |
|
MD5 | 67e31ee1cca4356bc3278d0750e19813 |
|
BLAKE2b-256 | 3846f746c325433e14d93d1e4dc7864fdcb4ab3bb877620a38dda614f3ca5030 |