The code fails to access JSON object if it's key contain dots.
JSON:
"TableTraps": {
"1.3.6.1.4.1.100.108.0.3": {
"Vars": [
"alarmDescription",
"alarmPositionUnit",
"alarmChannel"
]
},
"1.3.6.1.4.1.100.108.0.4": {
"Vars": [
"alarmDescription",
"alarmPositionUnit",
"alarmChannel"
]
},
}
Pascal SuperObject code:
TableTraps := LoadFromFile();
TrapOID := '1.3.6.1.4.1.100.108.0.3';
trapInfo := TableTraps.O[TrapOID];
Results in trapInfo == nil
but I expect SuperObject instance.
I've tried to wrap the json key:
TrapOID := '"' + '1.3.6.1.4.1.100.108.0.3' + '"';
or
TrapOID := '''' + '1.3.6.1.4.1.100.108.0.3' + '''';
It doesn't help.
How should I call SuperObject to access the object instance if the json key contains dots?
Related question How to serialize JSON key containing dots (like e.g. IP address) with SuperObject?