I have a class that sometimes I need to merge into another class when serializing. Is it possible to add a descriptor to another descriptor? Essentially merging the elements together?
d
Dominaezzz
02/24/2022, 1:18 PM
Maybe but I'd need a concrete example.
j
Justin Breitfeller
02/24/2022, 3:45 PM
Im just thinking of the case where i have two classes like Car and Driver. I have to emit json where the fields from Car and Driver are in the same structure. I wanted to avoid having to rewrite the serialization code for both by merging their serializers together
Justin Breitfeller
02/24/2022, 4:49 PM
Another way to describe it perhaps would be, is there an easy way for me to merge a child object into my object (for serialization only). So that my json wouldn’t have a sub-object for that child object, the fields would just all be merged into one object