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
I was fiddling with composite data types, in particular with Reference to implement nested schemas, and there seems to be an issue with how arrays and objects of references are serialized when calling dict() on the parent class.
This causes issues when passing the result of dict(pb) or dict(pc) to, say, json.dumps(), because it gets Child instances which are not JSON-serializable.
Am I simply abusing Array and Object? Is there another way of implementing composite fields with nested schemas?
The text was updated successfully, but these errors were encountered:
Hey,
I was fiddling with composite data types, in particular with
Reference
to implement nested schemas, and there seems to be an issue with how arrays and objects of references are serialized when callingdict()
on the parent class.Consider the following schemas:
Test cases with what should happen IMO:
This causes issues when passing the result of
dict(pb)
ordict(pc)
to, say,json.dumps()
, because it getsChild
instances which are not JSON-serializable.Am I simply abusing
Array
andObject
? Is there another way of implementing composite fields with nested schemas?The text was updated successfully, but these errors were encountered: