Flatten JSON Object to JSONpath Array: recursive search of paths

Issue #70 resolved
Ivan Yakushchenko created an issue

Description of “Flatten JSON Object to JSONpath Array.vi” states that:

Takes a JSON Value and "flattens" the Object structure, producing out arrays of the $Paths to each item and the corresponding items. This works recursively on all subObjects.

But in case when there is array object which contains other objects, then it returns path just to array object. For example, for such JSON:

{
  "Systems": [
    {
      "SW": {
        "TEST": {
          "ENABLE": true
        }
      }
    },
    {
      "SW": {
        "TEST": {
          "ENABLE": false
        }
      }
    }
  ]
}

it returns just “$.Systems” path just, although could return also paths like “$.Systems[0].SW.TEST.ENABLE”, etc. (but then there is a question whether it should return root paths, or just “end” paths).

If this is the expected behavior, then it would be nice to note it in the description (that recursive search is not applied to array objects).

Thanks a lot in advance!

Sincerely, Ivan.

Comments (3)

  1. James Powell repo owner

    I’m following the terminology where an Array is not an “Object”, and thus excluded by the term “subObject”. But it doesn’t hurt to be extra clear in documentation.

  2. Log in to comment