Untitled

mail@pastecode.io avatar
unknown
python
a month ago
700 B
1
Indexable
Never
@swagger_auto_schema(
    method='post',
    operation_description="Create a donation with validation.",
    request_body=DonationSerializer,
    responses={
        201: openapi.Response(
            description="Donation created successfully",
            schema=DonationSerializer
        ),
        400: "Invalid request data"
    }
)
@swagger_auto_schema(
    method='get',
    operation_description="Return a list of donations.",
    responses={
        200: openapi.Response(
            description="A list of donations",
            schema=openapi.Schema(
                type=openapi.TYPE_ARRAY,
                items=openapi.Schema(type=openapi.TYPE_OBJECT)
            )
        )
    }
)
Leave a Comment