My further experiments shows that I am doing something wrong, or library lack of support for arrays or any kind of nesting.
I have 3 element array, each element is structure that contains fields int1, int2, float1, float2.
All initialized with unique values for better understanding.
I tried to create code that would first write it to JSON file (success), and then read (that fails).
Log from that run is:
LogBlueprintUserMessages: [BP_testJSON_C_UAID_18C04DED29E2085C02_2088169055] {
"arrayFlat": [
{
"int1": 1,
"int2": 2,
"float1": 3,
"float2": 4
},
{
"int1": 11,
"int2": 12,
"float1": 13,
"float2": 14
},
{
"int1": 21,
"int2": 22,
"float1": 23,
"float2": 24
}
]
}
LogJson: Warning: Ignoring excess properties when deserializing CallFunc_GetField_OutValue
LogBlueprintUserMessages: [BP_testJSON_C_UAID_18C04DED29E2085C02_2088169055] top level name=arrayFlat success=true
LogBlueprintUserMessages: [BP_testJSON_C_UAID_18C04DED29E2085C02_2088169055] nested name=int1 floatVal=1.0 success=true
LogBlueprintUserMessages: [BP_testJSON_C_UAID_18C04DED29E2085C02_2088169055] nested name=int2 floatVal=2.0 success=true
LogBlueprintUserMessages: [BP_testJSON_C_UAID_18C04DED29E2085C02_2088169055] nested name=float1 floatVal=3.0 success=true
LogBlueprintUserMessages: [BP_testJSON_C_UAID_18C04DED29E2085C02_2088169055] nested name=float2 floatVal=4.0 success=true
So at first level only arrayFlat is found - ok, that was expected.
But at second level there is no data about array, but looks like first element was parsed, and both loops ends.
Is this possible to do proper nested read of this JSON file that way?
It would be still far away from my “dream” function that would simply deserialize JSONstring->structure in opposite way to “Convert struct to JSON String”, but event that what I already tried seems not work at all.