FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit fa5f1706 authored by E. Evstafiev's avatar E. Evstafiev :bulb:
Browse files

feat(api): enhance AccountDetailsView with detailed OpenAPI response schemas

parent f2c9a1ce
No related branches found
No related tags found
1 merge request!52Resolve "Ensure OpenAPI specification is generated correctly"
......@@ -3,7 +3,7 @@ Views implementing the API endpoints.
"""
from drf_spectacular.utils import extend_schema
from drf_spectacular.utils import OpenApiResponse, extend_schema
from rest_framework import generics
from api.v1alpha.serializers import AccountSerializer
......@@ -13,6 +13,17 @@ from api.v1alpha.serializers import AccountSerializer
tags=["Account details"],
summary="Retrieve or update account details of the current logged in account",
description="Endpoint that returns or updates the details of the current logged in account.",
responses={
200: OpenApiResponse(
response=AccountSerializer,
description="Successful retrieval or update of account details.",
),
204: OpenApiResponse(
description="Successful update with no content to return when updating certain fields."
),
405: OpenApiResponse(description="Method not allowed."),
},
methods=["GET", "PATCH"],
)
class AccountDetailsView(generics.RetrieveUpdateAPIView):
serializer_class = AccountSerializer
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment