Skip to content

Commit

Permalink
Fixed refactor?
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelwilczewski committed Sep 1, 2023
1 parent 9621efc commit 5bfbcd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dataclasses_json/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ def _decode_generic(type_, value, infer_missing):
else: # Union (already decoded or try to decode a dataclass)
type_options = _get_type_args(type_)
res = value
if type(value) is not dict or dict not in type_options:
if type(value) is dict and dict in type_options:
# already decoded
# FIXME if all types in the union are dataclasses this
# will just pick the first option -
# maybe find the best fitting class in that case instead?
Expand Down

0 comments on commit 5bfbcd7

Please sign in to comment.