jsondaora
jsondaora copied to clipboard
Fix DeserializationError when passed a dataclasses.Field
The DeserializationError.dict method put the repr
of the objects that don't have a __name__
attribute on it's response.
This behaviour is wrong and must be changed to only a simple string.
Hi,
Do you mean the method itself or its return value ?
Hi!
This behaviour was wrong.
The else must extract a string from the self.args[0].type, but just try to cast to str
, then the objects references or __repr__
will be showed instead just the name.
type_name = (
self.args[0].type.__name__
if hasattr(self.args[0].type, '__name__')
else str(self.args[0].type)
)
https://github.com/dutradda/jsondaora/blob/fafe141edc931b4b8d6099a926110f948492b2d3/jsondaora/exceptions.py#L19