[BZ#702756] Different outputs from [*] and ['*'] selectors in JSONPath expressions
Submitted by Jacobo Aragunde Pérez <<jar..@..com>>
Assigned to json-glib-maint@gnome.bugs
Link to original bug (#702756)
Description
Created attachment 247339 Test code that reads JSON from a file and launches the two queries in question
Trying to get the grandchildren in the JSON code below using the selector $['test-root'][][] I got unexpected results:
{ "test-root": { "first-child-object":[ {"grandchild": 1}, {"grandchild": 2} ], "second-child-object":[ {"grandchild": 3} ] } }
That selector only returned one element. Nonetheless, the use of the selector $['test-root'][''][] returns the three grandchildren objects as expected.
I've tried the selector $['test-root'][][] with another JSONPath implementation (in particular the PHP implementation via [1]) and both expressions seem to be accepted and equivalent.
[1] http://jsonpath.curiousconcept.com/