drf-impression: Добавить описание в HTTP_204
@extend_schema(
request=MyRequestSerializer,
responses={200: MyResponseSerializer(many=True),
204: None,
},
examples=[
OpenApiExample(
'204',
status_codes=['204'],
summary="My documentation summary",
description="My documentation description",
response_only=True,
),
....]
)
1 ответ
новый
drf-spectacular
версия
0.15.1
добавил
OpenApiResponse
характерная черта. этот фрагмент взят из тестовых примеров:
from drf_spectacular.utils import OpenApiResponse, extend_schema
@extend_schema(
description='creation description',
responses={
201: OpenApiResponse(response=int, description='creation with int response.'),
204: OpenApiResponse(description='creation with no response.'),
223: None,
})