From 8fcd4025521d3db8c4c21cbed647da2b13425ab9 Mon Sep 17 00:00:00 2001 From: James Kachel Date: Tue, 21 Jan 2025 14:20:03 -0600 Subject: [PATCH] add a new URL to see if this causes the openapi check to fail --- sandbox/urls.py | 3 ++- sandbox/views.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sandbox/urls.py b/sandbox/urls.py index f9cf343b..6a3ea150 100644 --- a/sandbox/urls.py +++ b/sandbox/urls.py @@ -3,7 +3,7 @@ from django.urls import include, re_path from rest_framework import routers -from sandbox.views import SandboxViewSet +from sandbox.views import SandboxViewSet, return_nothing v0_router = routers.DefaultRouter() @@ -16,4 +16,5 @@ app_name = "v0" urlpatterns = [ re_path("^api/v0/", include((v0_router.urls, "v0"))), + re_path("^api/v0/sandbox/return_nothing", return_nothing), ] diff --git a/sandbox/views.py b/sandbox/views.py index deeea9d9..5b9247d9 100644 --- a/sandbox/views.py +++ b/sandbox/views.py @@ -3,6 +3,7 @@ from drf_spectacular.openapi import OpenApiParameter, OpenApiTypes from drf_spectacular.utils import extend_schema, inline_serializer from rest_framework import status +from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework.serializers import CharField, IntegerField from rest_framework.viewsets import ViewSet @@ -70,3 +71,17 @@ def retrieve(self, request, id: int): # noqa: A002, ARG002 except StopIteration: return Response(status=status.HTTP_404_NOT_FOUND) return Response(item) + + +@extend_schema( + description=("Retrieves the list of sandbox values."), + methods=["GET"], + request=None, + responses=SANDBOX_SERIALIZER, + operation_id="sandbox_zen_api_list", +) +@api_view(["GET"]) +def return_nothing(request): # noqa: ARG001 + """Return nothing.""" + + return Response()