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
When parsing with union an Optional value in a dataclass doesn't consider the existence of keys in dictionaries when parsing the structure. Please see the reproducer.
Hi, thanks for your work on the library.
Describe the bug
When parsing with union an Optional value in a dataclass doesn't consider the existence of keys in dictionaries when parsing the structure. Please see the reproducer.
To Reproduce
Consider the code below:
Expected behavior
I would expect
dacite
to look into dictionary keys and prefer an object which has the key.Environment
dacite
version: 1.8.1Additional context
Changing the order of classes in the Union annotation helps in this case.
The text was updated successfully, but these errors were encountered: