Skip to content

Add descriptions to responses. #345

@apollo13

Description

@apollo13

Describe the feature
@extend_schema currently lists many ways to document responses, but none of them allow setting the description. I am not sure what would be a good way to do so, maybe make the value in the dict a tuple of description & actual response?

drf-yasg did allow for this like this (not saying that I particularly like that approach):

ping_response = openapi.Response("response description", PingOutputSerializer)
@swagger_auto_schema(
    method="get",
    ...
    responses={200: ping_response},
)

Any ideas? I might be able to offer the code if there is a clear path :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfix confirmation pendingissue has been fixed and confirmation from issue reporter is pending

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions