I have a data structure with one field that changes depending on context, i.e.

struct Foo {
string var0;
int var1;
Variant var2;
};

How can I make the JSON serialization in Vibe.d treat var2 properly, and generate 10 if it is an int 10, but "xxyz" if it has a string value?