msrest-for-python icon indicating copy to clipboard operation
msrest-for-python copied to clipboard

msrest.serialization.Deserializer.deserialize_object() cannot handle subclasses

Open jazelenk opened this issue 3 years ago • 2 comments

    def deserialize_object(self, attr, **kwargs):
        ...
        obj_type = type(attr)
        ...
        if obj_type == dict:

The net effect is that when attr is a subclass of dict, the operation raises a TypeError, even though it could be deserialized as a dict.

Changing those if obj_type ==... checks to if isinstance(attr, ... would address this.

jazelenk avatar Jan 27 '22 17:01 jazelenk