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
Type of validation context #9411
Labels
bug V2
Bug related to Pydantic V2
Comments
OhioDschungel6
added
bug V2
Bug related to Pydantic V2
pending
Awaiting a response / confirmation
labels
May 8, 2024
Indeed, looks like our type hints could be improved. Would you be interested in opening a PR to fix this issue? Thanks for bringing it to our attention! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Initial Checks
Description
When using BaseModel.model_validate_json() or BaseModel.model_validate() the optional parameter "context" is typed to be a dict[str, Any].
This context is made available to validators via the ValidationInfo object.
The type of the info.context object is "Any | None" instead of "dict[str,Any] | None".
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: