How to reproduce:
1. Open the “SerializationTest“ project
2. Open the “SampleScene“
3. Enter the play mode
4. Observe the Console window
Expected result: The message logged in the Console window is
”Json:
{
"branchA": [],
"branchB": []
}
"
Actual result: The message logged in the Console window is
“Json:
{
"branchA":
{
"$id": 0,
"$elements": []
}
,
"branchB":
{
"$ref": 0
}
}"
Reproducible with: 2021.3.40f1, 2022.3.38f1, 6000.0.11f1
Reproducible on: macOS 14.5 (Intel), Windows 10 Pro (22H2)
Not reproducible on: No other environments tested
Workaround: Exchange the “branchA = new List<BranchClass>().ToArray()“ method to the “branchA = new BranchClass[0]"
Note: When converting just a “branchList = new List<BranchClass>()“ list to JSON, the output is as expected “ "branchList": [] "