Wrong assignement of values in Union[Foo, List[Foo]]
#3365
Labels
bug V1
Bug related to Pydantic V1.X
Union[Foo, List[Foo]]
#3365
Checks
Bug
When validating a model that allows either a single object
Foo
or a list ofFoo
objects, the wrong values are assigned. The key of the second parameter is assigned as value of the first parameter (which is a string).Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:The following minimal example repruduces the bug:
foo=Foo(a='b', b=None)
foo=[Foo(a='some string', b=1.0), Foo(a='another string', b=2.0)]
I am not sure if this is related somehow to #2092
The text was updated successfully, but these errors were encountered: