Closed AngelEzquerra closed 5 years ago
hi @AngelEzquerra :) Could you reformat your code? It's hard to read.
Sorry about that. It is fixed now :-)
@AngelEzquerra i checked your example and it works like it should.
This test works for me:
def test_from_dict_issue_50():
@dataclass
class item:
item_field: str = 'default_value'
@dataclass
class container:
dict_of_dict_of_dataclass: Dict[str, Dict[str, item]] = field(default_factory=dict)
complex_dict = {'dict_of_dict_of_dataclass': {'outer': {'inner': {'item_field': 'a value'}}}}
obj = from_dict(container, complex_dict)
assert type(obj.dict_of_dict_of_dataclass['outer']['inner']) == item
Which version of dacite
are you using?
The following code does not work as I would expect:
If I remove one dict level from the structure, it works as expected: