JsonCollectionParser icon indicating copy to clipboard operation
JsonCollectionParser copied to clipboard

Input data format descend

Open ogrosko opened this issue 4 years ago • 3 comments

Hello,

Is it possible to descend in JSON structure? Suppose I have data format like:

         {
            "objects": [
                {
                    "uid": 1,
                    "name": "Name 1"
                },
                {
                    "uid": 2,
                    "name": "Name 2"
                }
            ]
        }

So I can walk through the objects items Thank you

ogrosko avatar Dec 23 '20 13:12 ogrosko

@ogrosko the structure you provided is not supported - you have to put commas between your objects like this:

{
            "objects": [
                {
                    "uid": 1,
                    "name": "Name 1"
                },
                {
                    "uid": 2,
                    "name": "Name 2"
                }
            ]
        }

MAXakaWIZARD avatar Dec 23 '20 20:12 MAXakaWIZARD

@MAXakaWIZARD woops sorry, typo in my example json. I already fixed it. But my question is: whether I can iterate over "objects". In other words: When I want to iterate over objects I have to strip "objects" from the json and then It gives me results as expected. So I have to JSON like this:

                {
                    "uid": 1,
                    "name": "Name 1"
                },
                {
                    "uid": 2,
                    "name": "Name 2"
                }

ogrosko avatar Jan 05 '21 12:01 ogrosko

@ogrosko at the moment iterating over objects is supported only for root-level objects

MAXakaWIZARD avatar Jan 05 '21 17:01 MAXakaWIZARD