Page MenuHomeFeedback Tracker

JsonSerializer type detection issue
Reviewed, NormalPublic

Description

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.

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Engine

Event Timeline

Grim created this task.Jan 29 2019, 5:38 PM
Geez changed the task status from New to Assigned.Jan 30 2019, 5:18 PM
Geez changed the task status from Assigned to Reviewed.Feb 4 2019, 2:01 PM
Geez added a subscriber: Geez.

Hello Grim and thank you for the report.
This works as designed as serializer does not support polymorphism.
Regards,
Geez