I'm writing a parser for configuration jsons from a particular game. The structure is sometimes complicated (say there can be a "Tape" class object, which holds different objects for different animation types, i.e. SizeAnim, TranslationAnim etc.). The class name for every object is always supplied though a "__class" value in the json. So it looks something like this:
{
"__class": "Tape",
"Animations": [{
"__class": "SizeAnim",
"AnimationData": "somedata"
},
{
"__class": "TranslationAnim",
"DifferentData": ""
}]
}
Now the question is: is it possible to instruct the json serializer/deserializer to use the "__class" field, instead of "$type" to determine the type of the object?