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.4.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6af0583a698e04c3bc7260f0768d9cbeb8dd6aac7ad5c58221dd58db948d6e7 |
|
MD5 | 52255d8b2e9b65c3cbf10dbda63d8ca4 |
|
BLAKE2b-256 | 20cd83afae82635c4771a367fc64ff96a5db5e6445ce60a5fbe58ea20baee46d |
Close
Hashes for drf_spectacular_jsonapi-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 793d8e8cafbb72c727563c5dcb92a120ce83fd8a60f9848d6b5da39422ca143e |
|
MD5 | 8793dde556d8a73299b600d3ffd8d0af |
|
BLAKE2b-256 | 11a9d892c17951e8a43a3dad77b7b402101159a2ab56982357c4b293aafcd342 |