madman-bob / python-dataclasses-serialization

Serialize/deserialize Python dataclasses to various other data formats
MIT License
25 stars 11 forks source link

General exception when trying to deserialize dict to dataclass #11

Open DanielleFundbox opened 4 years ago

DanielleFundbox commented 4 years ago

This code

        return cls(**{
            fld.name: deserialization_func(fld_type, dct[fld.name])
            for fld, fld_type in zip(flds, fld_types)
            if fld.name in dct
        })
    except TypeError:
        raise DeserializationError("Missing one or more required fields to deserialize {!r} as {}".format(
            dct,
            cls
        ))

results with the same exception every time without specifying the problematic field or the field type