To me it doesn't seem useful to serialize the names of the variant constructors like this. I think if I ever did want that shape of output maybe I could explicitly specify a tuple or something in the type that I'm deriving from.
Is there any way I can suppress this behaviour and serialize the variant "anonymously"? (while still deriving from a record type)
I am trying to serialize a JSON list which contains objects of two different kinds, like:
I thought I could model this with record and variant types like:
But when I serialize this I get:
To me it doesn't seem useful to serialize the names of the variant constructors like this. I think if I ever did want that shape of output maybe I could explicitly specify a tuple or something in the type that I'm deriving from.
Is there any way I can suppress this behaviour and serialize the variant "anonymously"? (while still deriving from a record type)