-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
RequestValidationError is **not** a sub-class of Pydantic's ValidationError #10424
Open
9 tasks done
Open
9 tasks done
Comments
Kludex
added
question
Question or problem
docs
Documentation about how to use FastAPI
labels
Oct 11, 2023
Should we fix the docs or the code? IMO having Pydantic's error makes more sense. |
Documentation. But I'm just bringing it to @tiangolo 's attention. |
hey Please choose this format Here is main.py
Here is exception.py
Here is my design pattern publically available |
9 tasks
This comment was marked as spam.
This comment was marked as spam.
This PR ( #11176 ) seems to fix it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussed in #10421
Originally posted by valentinoli October 10, 2023
First Check
Commit to Help
Example Code
Description
I was trying to handle both
RequestValidationError
andValidationError
by writing a custom handler forValidationError
but that doesn't work.The docs state that
However, looking at FastAPI source code reveals that this is not the case.
Operating System
Linux
Operating System Details
No response
FastAPI Version
0.101.0
Pydantic Version
2.1.1
Python Version
3.11.3
Additional Context
No response
The text was updated successfully, but these errors were encountered: