PaesslerAG / jsonpath

BSD 3-Clause "New" or "Revised" License
172 stars 37 forks source link

Incorrect full path on search - bug #22

Open moshevi opened 4 years ago

moshevi commented 4 years ago

I think I should get the full paths and values when running this expression {#: $.a.b.c..[?(@.e == 1)]} on this json:

{
  "a": {
       "x": {
           "d":1
       },
       "b": {
           "c": {
               "da" : {
                   "d" : 2
                },
 "db" : {
                   "d" : 1
                },
            }
        }
  }
}

when running this I get this path $["db"] while I should get the full path which is $["a"]["b"]["c"]["db"]

I can run this expression {#: $..[?(@.e == 1)]} but I don't want to search the all tree and get also the $["a"]["x"] path, just what under a.b.c hierarchy Is there a fix for that?

moshevi commented 4 years ago

Is there a planned fix for that?