Skip to content

Commit 20f0464

Browse files
committed
Fix OpanAPI schema base path
1 parent 1952707 commit 20f0464

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

netbox/core/api/schema.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
import re
22
import typing
33

4-
from drf_spectacular.extensions import (
5-
OpenApiSerializerFieldExtension,
6-
OpenApiViewExtension,
7-
)
4+
from drf_spectacular.extensions import OpenApiSerializerFieldExtension
85
from drf_spectacular.openapi import AutoSchema
96
from drf_spectacular.plumbing import (
10-
ComponentRegistry,
11-
ResolvedComponent,
12-
build_basic_type,
13-
build_choice_field,
14-
build_media_type_object,
15-
build_object_type,
16-
get_doc,
17-
is_serializer,
7+
build_basic_type, build_choice_field, build_media_type_object, build_object_type, get_doc,
188
)
199
from drf_spectacular.types import OpenApiTypes
20-
from drf_spectacular.utils import extend_schema
2110
from rest_framework.relations import ManyRelatedField
2211

2312
from netbox.api.fields import ChoiceField, SerializedPKRelatedField

netbox/netbox/settings.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,13 +616,15 @@ def _setting(name, default=None):
616616
#
617617

618618
SPECTACULAR_SETTINGS = {
619-
'TITLE': 'NetBox API',
620-
'DESCRIPTION': 'API to access NetBox',
619+
'TITLE': 'NetBox REST API',
621620
'LICENSE': {'name': 'Apache v2 License'},
622621
'VERSION': VERSION,
623622
'COMPONENT_SPLIT_REQUEST': True,
624623
'REDOC_DIST': 'SIDECAR',
625-
'SERVERS': [{'url': f'/{BASE_PATH}api'}],
624+
'SERVERS': [{
625+
'url': BASE_PATH,
626+
'description': 'NetBox',
627+
}],
626628
'SWAGGER_UI_DIST': 'SIDECAR',
627629
'SWAGGER_UI_FAVICON_HREF': 'SIDECAR',
628630
'POSTPROCESSING_HOOKS': [],

0 commit comments

Comments
 (0)