-
Notifications
You must be signed in to change notification settings - Fork 967
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
Add errors fast api #18093
base: dev
Are you sure you want to change the base?
Add errors fast api #18093
Conversation
/** @description Bad Request */ | ||
400: { | ||
content: { | ||
"application/json": components["schemas"]["MessageExceptionModel"]; | ||
}; | ||
}; | ||
/** @description Validation Error */ | ||
422: { | ||
content: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the 422 is still getting generated in the resulting schema so remove_422
doesn't seem to work as expected. We could keep the 422 as a validation-specific error though given the response data is in the format we want and adapt the client error handling to support it. What do others think about this?
Have a look at https://fastapi.tiangolo.com/tutorial/handling-errors/#override-request-validation-exceptions and this discussion tiangolo/fastapi#9061 if you haven't already, maybe there is an interesting solution there.
What did you do?
Why did you make this change?
The Validation error should be replaced by the Bad request error as it is not the real model that is returning.
How to test the changes?
License