Fix ValidationInfo.data missing with model_validate_json()#13079
Merged
davidhewitt merged 3 commits intomainfrom Apr 15, 2026
Merged
Fix ValidationInfo.data missing with model_validate_json()#13079davidhewitt merged 3 commits intomainfrom
ValidationInfo.data missing with model_validate_json()#13079davidhewitt merged 3 commits intomainfrom
Conversation
Deploying pydantic-docs with
|
| Latest commit: |
67ac6fd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2553eee6.pydantic-docs.pages.dev |
| Branch Preview URL: | https://dh-validate-by-json-val-info.pydantic-docs.pages.dev |
model_validate_jsonValidationInfo.data missing with model_validate_json()
Viicos
reviewed
Apr 15, 2026
Merging this PR will degrade performance by 18.75%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_failed_rebuild |
244.2 µs | 300.5 µs | -18.75% |
| ⚡ | test_simple_recursive_model_schema_generation |
839.9 µs | 620.1 µs | +35.45% |
Comparing dh/validate-by-json-val-info (67ac6fd) with main (71f0c4b)
Contributor
Co-authored-by: Victorien <[email protected]>
Viicos
approved these changes
Apr 15, 2026
Viicos
added a commit
that referenced
this pull request
Apr 15, 2026
Backport of: #13079 Co-authored-by: Victorien <[email protected]>
Closed
4 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Summary
This PR fixes
ValidationInfo.datamissing when usingmodel_validate_json. This is done by delaying validation of input JSON values until the JSON document has been full parsed; the validations can then be carried out in field order.Related issue number
Fixes #13074
Checklist