Fix AttributeError in ObjectSerializer by checking for __dict__ attribute
Co-authored-by: alexta69 <7450369+alexta69@users.noreply.github.com>
This commit is contained in:
parent
136c722636
commit
916ed330dd
|
|
@ -115,7 +115,7 @@ config = Config()
|
||||||
|
|
||||||
class ObjectSerializer(json.JSONEncoder):
|
class ObjectSerializer(json.JSONEncoder):
|
||||||
def default(self, obj):
|
def default(self, obj):
|
||||||
if isinstance(obj, object):
|
if hasattr(obj, '__dict__'):
|
||||||
return obj.__dict__
|
return obj.__dict__
|
||||||
else:
|
else:
|
||||||
return json.JSONEncoder.default(self, obj)
|
return json.JSONEncoder.default(self, obj)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue