Support top-level arrays in the json post-processor for webpage data sources
We have a location that returns JSON data, and have written a webpage datasource to parse this.
The JSON data is returned as an array in the top-level, not an object, which as per RFC 4627 is valid JSON. The current JSON post-processor appears to have no way of dealing with this.
A sample of something that works and something that doesn\'t may help to illustrate the problem:
If the data returned from my webpage was this, and I wished to access the \'value\' element of the first item, it would be no problem:
{ \'\'array_of_data\'\': [ { \'\'name\'\': \'\'name1\'\', \'\'value\'\': 123}, { \'\'name\'\': \'\'name2\'\', \'\'value\'\': 234 } ] }
To parse out the value 123 from this, I would use array_of_data[0].value in the post-processor field
However, my data actually just looks like this:
[ { \'\'name\'\': \'\'name1\'\', \'\'value\'\': 123}, { \'\'name\'\': \'\'name2\'\', \'\'value\'\': 234 } ]
So the array is at the top level. There appears to be no way of referring to this in the post-processor field. I have tried [0].value but to no avail. And as the outer array has no name, there is no name to refer to it by.
It would be great if we could use jq-like ( http://stedolan.github.io/jq/ ) filters or have some other way of extracting this information.
Thanks!