Skip to content

Commit

Permalink
add a new URL to see if this causes the openapi check to fail
Browse files Browse the repository at this point in the history
  • Loading branch information
jkachel committed Jan 21, 2025
1 parent 0483f71 commit 8fcd402
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sandbox/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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),
]
15 changes: 15 additions & 0 deletions sandbox/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

0 comments on commit 8fcd402

Please sign in to comment.