Skip to content

Commit a956ec2

Browse files
committed
squash!: Add missing schema docs for OrgsAPIView
1 parent bfad1c0 commit a956ec2

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

openedx_authz/rest_api/v1/views.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import edx_api_doc_tools as apidocs
1111
from django.contrib.auth import get_user_model
1212
from django.http import HttpRequest
13+
from edx_api_doc_tools import schema_for
1314
from organizations.models import Organization
1415
from rest_framework import filters, generics, status
1516
from rest_framework.response import Response
@@ -454,6 +455,18 @@ def get(self, request: HttpRequest) -> Response:
454455

455456

456457
@view_auth_classes()
458+
@schema_for(
459+
"get",
460+
parameters=[
461+
apidocs.query_parameter("search", str, description="Filter orgs by name or short_name"),
462+
apidocs.query_parameter("page", int, description="Page number for pagination"),
463+
apidocs.query_parameter("page_size", int, description="Number of items per page"),
464+
],
465+
responses={
466+
status.HTTP_200_OK: OrganizationSerializer(many=True),
467+
status.HTTP_401_UNAUTHORIZED: "The user is not authenticated",
468+
},
469+
)
457470
class OrgsAPIView(generics.ListAPIView):
458471
"""
459472
API view for listing orgs

0 commit comments

Comments
 (0)