gluon
gluon copied to clipboard
Derived Variant serialization is untagged
Deriving Serialize
on a variant leads to an untagged representation right now. This means that serializing variants such as type Variant = | A | B
or type Variant = | A String | B String
is not reversible. In the former case, both will serialize to null
, and in the latter, both will serialize to the contained string.
Would it make sense to change the default derived scheme of Variants to an Externally Tagged or Adjacently Tagged model?
Certainly, though having an attribute to keep it as untagged should still exist since it is needed for some uses (untagged was just the first representation I needed).