9608 update yasg -> spectacular

This commit is contained in:
Arthur 2023-01-24 10:25:04 -08:00
parent 590e7af995
commit ac235b7990
3 changed files with 6 additions and 6 deletions

View File

@ -162,7 +162,7 @@ class ConfigContextViewSet(NetBoxModelViewSet):
class ReportViewSet(ViewSet):
permission_classes = [IsAuthenticatedOrLoginNotRequired]
_ignore_model_permissions = True
exclude_from_schema = True
schema = None
lookup_value_regex = '[^/]+' # Allow dots
def _retrieve_report(self, pk):
@ -269,7 +269,7 @@ class ReportViewSet(ViewSet):
class ScriptViewSet(ViewSet):
permission_classes = [IsAuthenticatedOrLoginNotRequired]
_ignore_model_permissions = True
exclude_from_schema = True
schema = None
lookup_value_regex = '[^/]+' # Allow dots
def _get_script(self, pk):

View File

@ -30,7 +30,7 @@ class InstalledPluginsAPIView(APIView):
"""
permission_classes = [permissions.IsAdminUser]
_ignore_model_permissions = True
exclude_from_schema = True
schema = None
def get_view_name(self):
return "Installed Plugins"
@ -53,7 +53,7 @@ class InstalledPluginsAPIView(APIView):
@extend_schema(exclude=True)
class PluginsAPIRootView(APIView):
_ignore_model_permissions = True
exclude_from_schema = True
schema = None
def get_view_name(self):
return "Plugins"

View File

@ -13,17 +13,17 @@ from rq.worker import Worker
from netbox.api.authentication import IsAuthenticatedOrLoginNotRequired
@extend_schema(exclude=True)
class APIRootView(APIView):
"""
This is the root of NetBox's REST API. API endpoints are arranged by app and model name; e.g. `/api/dcim/sites/`.
"""
_ignore_model_permissions = True
exclude_from_schema = True
# schema = None
def get_view_name(self):
return "API Root"
@extend_schema(exclude=True)
def get(self, request, format=None):
return Response({