You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is likely related to #1710 but does not explicitly involve validators. This would be a good candidate for a unit test to prevent future regressions.
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":
Hello @johnanthonyowens you are right !
I added your example in the unit tests of the fix 16e489b and updated the changelog.
Thanks for the suggestion as the regression did not only impact the validation of nested models but also the parsing!
PrettyWood
added a commit
to PrettyWood/pydantic
that referenced
this issue
Jul 13, 2020
…#1712)
* fix: validate nested models with `default_factory`
PR #1504 introduced a regression by bypassing `populate_validators()`,
which would skip the validation of children in nested models
with `default_factory`
closes#1710
* test: add example of nested models parsing with `default_factory`
closes#1717
* add testcase from #1722
* bodge for benchmarks
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
Bug
This is likely related to #1710 but does not explicitly involve validators. This would be a good candidate for a unit test to prevent future regressions.
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:Here is a self-contained example illustrating the problem:
In 1.6, this prints:
inner_1={'value': 'default'} inner_2=Inner(value='default')
Note that
inner_1
is a dict, not anInner
object!In 1.5.1 this prints:
inner_1=Inner(val=0) inner_2=Inner(val=0)
The text was updated successfully, but these errors were encountered: