The JSON serialization format should be updated so that structures use a discriminator field named type.
Instead of nesting variant data under the variant name, the variant should be expressed using a top-level type field.
Example before:
{
"variant": {
"field1": "string",
"field2": 123
}
}
Example after:
{
"type": "variant",
"field1": "string",
"field2": 123
}