-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Old HTTPValidationError
and ValidationError
OpenAPI entry
#10787
Comments
It would be cool to have an API to modify the |
This is what we need right? But this change would require changing a lot of tests. |
app = FastAPI() Your existing OpenAPI definitionsvalidation_error_definition = {...} Add the existing definitions to the appapp.openapi_schema["components"]["schemas"]["ValidationError"] = validation_error_definition Define the new definition for HTTPValidationError (modify as needed)new_http_validation_error_definition = { Update the OpenAPI entryupdate_openapi_entry(app, new_http_validation_error_definition) Your FastAPI routes and other configurations go hereusing this code stay happy 👍 |
Privileged issue
Issue Content
Those lines need to be updated:
https://github.com/tiangolo/fastapi/blob/36c26677682c4245183912e00fc057c05cc6cf7a/fastapi/openapi/utils.py#L36-L61
They reflect how it was before 0.100.0, but with Pydantic V2, that's no longer true.
The text was updated successfully, but these errors were encountered: