Lets say we have a generic function
static bool DoStuff(BaseDataType data, typename dataType) { string outString; auto dataBuffer = dataType.Spawn(); dataBuffer = data; Print(dataBuffer.Type()); if(serilizer.WriteToString(dataBuffer,false,outString)) { Print(outString); return true; }; return false; }
In this case dataBuffer.Type() will return correct type. But JsonSerializer will see it as Class and that will result in {} json string.
Idea here is additional parameter to WriteToString/ReadFromString that would indicate if full class traverse is done. Not blindly fallow type that is passed in.