forked from pydantic/pydantic
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: forward ref with nested models and optional fields
PR pydantic#1712 introduced a regression for forward refs in `ModelField.prepare` as it would not return early for forward refs anymore. Optional fields would hence have `required` set to `True`. closes pydantic#1736
- Loading branch information
1 parent
e985857
commit 6961567
Showing
3 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix behaviour with forward refs and optional fields in nested models |
This file contains 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
This file contains 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