Describe the bug
When an attribute of a Model is a dict with another Model for values, retrieval fails with a pydantic_core._pydantic_core.ValidationError
pydantic_core._pydantic_core.ValidationError: 2 validation errors for Parent
children.one
Input should be a valid dictionary or instance of Child [type=model_type, input_value='{"id":"62589e3d29c147299...d0","name":"bill bing"}', input_type=str]
For further information visit https://errors.pydantic.dev/2.7/v/model_type
children.two
Input should be a valid dictionary or instance of Child [type=model_type, input_value='{"id":"1585e3a8a9ae479c9...06","name":"boom bing"}', input_type=str]
For further information visit https://errors.pydantic.dev/2.7/v/model_type
Expected behavior
One would expect the Parent object is retrieved with it's children.
Describe the bug When an attribute of a
Model
is adict
with anotherModel
for values, retrieval fails with apydantic_core._pydantic_core.ValidationError
To Reproduce The following code fails:
with the following error:
Expected behavior One would expect the
Parent
object is retrieved with it's children.