Hello all!
If I have a nested JSON
@startuml
!$testjson = {
"A": {
"A1": "val1",
"A2": "val2",
"B": {
"B1": "val3",
"B2": "val4",
"C": {
"C1": "val5",
"C2": "val6"
}
},
"D": {
"D1": "val7",
"D2": "val8"
}
}
}
@enduml
is there a nice way of using the JSON commands to be able to add a key value pair at any given level of nesting?
such as (example with python style notation)
$testjson["A"]["B"]["C"]["E"] = "eee"
$testjson["A"]["B"]["F"] = "fff"
I have played around with combinations of %json_add, %json_set, and %json_merge but I can't figure out how to properly use them beyond single nested JSON
I have been able to get some nested modification to work but in really hacky ways that erases nested JSON for adjacent keys to the key path that I am trying to modify
Any help is appreciated Thank you :)