Page MenuHomeFeedback Tracker

Change SCR_JsonLoadContext read behavior to ignore complex properties not mentioned in the json data
Closed, ResolvedPublic

Description

Right now even if the JSON has no changes for it, any complex property of an object being read into is created by default. This feels unintuitive, as only properties that are keys in JSON should be touched.

class HelloWorld
{
    void HelloWorld()
    {
        Print("HelloWorld::Ctor()");
    }
}

class Holder
{
    ref HelloWorld m_pHelloWorld;
}

Holder holder();
Print(holder.m_pHelloWorld);
SCR_JsonLoadContext reader();
reader.ImportFromString("{}");
reader.ReadValue("", holder);
Print(holder.m_pHelloWorld);

SCRIPT : HelloWorld m_pHelloWorld = NULL
SCRIPT : HelloWorld::Ctor()
SCRIPT : HelloWorld m_pHelloWorld = HelloWorld<0x000002D755EA9070>

Details

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

Event Timeline

Arkensor created this task.May 19 2023, 7:08 PM
Geez changed the task status from New to Assigned.May 23 2023, 12:31 PM
Geez closed this task as Resolved.May 24 2023, 11:57 AM
Geez claimed this task.
Geez added a subscriber: Geez.

Fixed for 0.9.9