python-dataclasses-serialization icon indicating copy to clipboard operation
python-dataclasses-serialization copied to clipboard

General exception when trying to deserialize dict to dataclass

Open DanielleFundbox opened this issue 5 years ago • 0 comments

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

DanielleFundbox avatar Sep 02 '20 07:09 DanielleFundbox