-
Notifications
You must be signed in to change notification settings - Fork 274
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
DRF exception handling #119
Comments
https://github.com/ivlevdenis/drf_pretty_exception_handler#features has a nice summary of the very varied response payloads that default DRF emits. |
A possible (temporary?) solution would to create a post-processing hook to append the following to every path. responses:
...
default:
insert_ref_here_to_a_component_broadly_describing_of_all_drf_possible_responses |
Closed
Closing in favour of #101 , with a comment there for some considerations. |
wmfgerrit
pushed a commit
to wikimedia/wikimedia-toolhub
that referenced
this issue
Feb 3, 2021
Document the general error message structure in our generated OpenAPI schema. This uses a technique suggested in <tfranzel/drf-spectacular#119> to augment the schema. In the future an implementation for <tfranzel/drf-spectacular#101> may make this code obsolete. Bug: T268774 Change-Id: I77c3afffc90213d44f394e17314b28938136a325
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the value of setting
REST_FRAMEWORK.EXCEPTION_HANDLER
is the default, the responses for each end-point should include response types for the exceptions it handles.https://github.com/encode/django-rest-framework/blob/82c2b5c3e75debe047eebd8a17b50c1e17594663/docs/api-guide/exceptions.md
This includes many of the 400s, notably doesnt include 500s.
Also it would be lovely if the extension framework here was used so that custom values of REST_FRAMEWORK.EXCEPTION_HANDLER loaded any extension targetting that class, so that e.g.
drf-problems
can be supported, but there are many others commonly used likedrf-friendly-errors
.The text was updated successfully, but these errors were encountered: