mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fix OpanAPI schema base path
This commit is contained in:
committed by
Jeremy Stretch
parent
1952707702
commit
20f0464824
@ -1,23 +1,12 @@
|
|||||||
import re
|
import re
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
from drf_spectacular.extensions import (
|
from drf_spectacular.extensions import OpenApiSerializerFieldExtension
|
||||||
OpenApiSerializerFieldExtension,
|
|
||||||
OpenApiViewExtension,
|
|
||||||
)
|
|
||||||
from drf_spectacular.openapi import AutoSchema
|
from drf_spectacular.openapi import AutoSchema
|
||||||
from drf_spectacular.plumbing import (
|
from drf_spectacular.plumbing import (
|
||||||
ComponentRegistry,
|
build_basic_type, build_choice_field, build_media_type_object, build_object_type, get_doc,
|
||||||
ResolvedComponent,
|
|
||||||
build_basic_type,
|
|
||||||
build_choice_field,
|
|
||||||
build_media_type_object,
|
|
||||||
build_object_type,
|
|
||||||
get_doc,
|
|
||||||
is_serializer,
|
|
||||||
)
|
)
|
||||||
from drf_spectacular.types import OpenApiTypes
|
from drf_spectacular.types import OpenApiTypes
|
||||||
from drf_spectacular.utils import extend_schema
|
|
||||||
from rest_framework.relations import ManyRelatedField
|
from rest_framework.relations import ManyRelatedField
|
||||||
|
|
||||||
from netbox.api.fields import ChoiceField, SerializedPKRelatedField
|
from netbox.api.fields import ChoiceField, SerializedPKRelatedField
|
||||||
|
@ -616,13 +616,15 @@ REST_FRAMEWORK = {
|
|||||||
#
|
#
|
||||||
|
|
||||||
SPECTACULAR_SETTINGS = {
|
SPECTACULAR_SETTINGS = {
|
||||||
'TITLE': 'NetBox API',
|
'TITLE': 'NetBox REST API',
|
||||||
'DESCRIPTION': 'API to access NetBox',
|
|
||||||
'LICENSE': {'name': 'Apache v2 License'},
|
'LICENSE': {'name': 'Apache v2 License'},
|
||||||
'VERSION': VERSION,
|
'VERSION': VERSION,
|
||||||
'COMPONENT_SPLIT_REQUEST': True,
|
'COMPONENT_SPLIT_REQUEST': True,
|
||||||
'REDOC_DIST': 'SIDECAR',
|
'REDOC_DIST': 'SIDECAR',
|
||||||
'SERVERS': [{'url': f'/{BASE_PATH}api'}],
|
'SERVERS': [{
|
||||||
|
'url': BASE_PATH,
|
||||||
|
'description': 'NetBox',
|
||||||
|
}],
|
||||||
'SWAGGER_UI_DIST': 'SIDECAR',
|
'SWAGGER_UI_DIST': 'SIDECAR',
|
||||||
'SWAGGER_UI_FAVICON_HREF': 'SIDECAR',
|
'SWAGGER_UI_FAVICON_HREF': 'SIDECAR',
|
||||||
'POSTPROCESSING_HOOKS': [],
|
'POSTPROCESSING_HOOKS': [],
|
||||||
|
Reference in New Issue
Block a user