You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/Users/sgran/source/wagestream/us-ws-api/scratch/t.py", line 32, in <module>
print(json.dumps(request.to_dict()))
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type DepositoryAccountSubtype is not JSON serializable
The text was updated successfully, but these errors were encountered:
It appears the problem is actually related to the use of DepositoryAccountSubtypes. If I substitute a simple [DepositoryAccountSubtype] for it in the schema, changing the constructor to:
Expectation:
Calling to_dict() on a model class will produce a dictionary composed of base types that can be correctly serialized to/from json.
Behaviour:
Deeply nested lists appear to be incorrectly handled.
The following code:
produces the following exception:
The text was updated successfully, but these errors were encountered: