How to read recursive json data with json spirit

314 Views Asked by At

I have a recursive Json file the format is below; I have two parts condition and action. In condition part there can be n-root and leaves pairs, and inside leaves part there can be additional values. I have problems about handling this data structure using json-spirit. Can anyone had same issue and solved or anyone have any clue. I would be appreciate. Thanks

{ 
 "condition": { 
                "root": "&",
                "leaves": [ "A",
                              { "root": "|",
                                "leaves": ["p","r"]
                               }
                        ]
                },
 "action": ["a=7","event B"]
}
1

There are 1 best solutions below

3
On

I dont know json-spirit. Do you absolutlely need to use it ?

If not, you may try this : https://github.com/Rel4X/HandyJson

Really easy to use (and I'd love some tests \o/)

Rel4x