Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description in response #116

Closed
Niccolum opened this issue Jul 8, 2020 · 5 comments
Closed

Description in response #116

Niccolum opened this issue Jul 8, 2020 · 5 comments

Comments

@Niccolum
Copy link

Niccolum commented Jul 8, 2020

Is it possible to pass description in every type of response in dict?

@ghost
Copy link

ghost commented Jul 8, 2020

can you to clarify what you mean by that exactly?

@Niccolum
Copy link
Author

Niccolum commented Jul 8, 2020

Of course.
https://swagger.io/docs/specification/describing-responses/
description field.

For example:

    responses:
        '200':
          description: OK
        '400':
          description: Bad request. User ID must be an integer and larger than 0.
        '401':
          description: Authorization information is missing or invalid.
        '404':
          description: A user with the specified ID was not found.
        '5XX':
          description: Unexpected error.

@tfranzel
Copy link
Owner

tfranzel commented Jul 8, 2020

currently there is no mechanism for that. i think it is related to #101. in case you want to solve those this via APIExceptions , #101 would give you the code and description automatically from listing the possible exceptions in @extend_schema. it would not allow for the 200 description, but you could describe that via the serializer description or summary anyway.

@Niccolum
Copy link
Author

Niccolum commented Jul 8, 2020

Yep, this is that i need. Thanks!
Will be great, if this will be in docs.
So, i have answer and close issue)

@Niccolum Niccolum closed this as completed Jul 8, 2020
@tfranzel
Copy link
Owner

tfranzel commented Jul 8, 2020

awesome. i already started on #101 but was missing the time to complete it. will happen very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants