After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702756 - Different outputs from [*] and ['*'] selectors in JSONPath expressions
Different outputs from [*] and ['*'] selectors in JSONPath expressions
Status: RESOLVED OBSOLETE
Product: json-glib
Classification: Core
Component: Core
git master
Other Linux
: Normal normal
: ---
Assigned To: json-glib-maint
json-glib-maint
Depends on:
Blocks:
 
 
Reported: 2013-06-20 15:53 UTC by Jacobo Aragunde Pérez
Modified: 2017-09-05 10:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test code that reads JSON from a file and launches the two queries in question (1.28 KB, text/x-csrc)
2013-06-20 15:53 UTC, Jacobo Aragunde Pérez
Details
JSON encoded piece of data as example (166 bytes, application/octet-stream)
2013-06-20 15:54 UTC, Jacobo Aragunde Pérez
Details

Description Jacobo Aragunde Pérez 2013-06-20 15:53:57 UTC
Created attachment 247339 [details]
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/
Comment 1 Jacobo Aragunde Pérez 2013-06-20 15:54:39 UTC
Created attachment 247340 [details]
JSON encoded piece of data as example
Comment 2 Emmanuele Bassi (:ebassi) 2017-09-05 10:39:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/json-glib/issues/7.