jsonPath with special character

Hi Guys,

the following jsonPath check doesn’t find anything but if I check the expression with an online evaluator e.g. http://jsonpath.com/ then I’ll get my object

'0' => "71"

gatling-check

`
.check(jsonPath("$.rampup.jslobs.[?(@.id==‘io.ox/core’)].tree.folder.calendar").ofType[Int].saveAs(FID_CALENDAR))

`

console:

`

---- Errors --------------------------------------------------------------------

jsonPath($.rampup.jslobs.[?(@.id==‘io.ox/core’)].tree.folder.c 1 (100,0%)
alendar).find(0).exists, found nothing

Mmm, IMO, your expression is not valid and the online evaluator you’re using is crap.
Get a look at the pseudo spec, I don’t think “.[?(” is valid.
Dots are separators, so child name is missing here (it would be * in your case).
I think we should crash on such expression, not return nothing.

See https://github.com/gatling/jsonpath/issues/21

Well I removed the dot and tried the expression, which looks valid to me, "$.rampup.jslobs[?(@.id==‘io.ox/core’)].tree.folder.calendar" again with different tools/testers and every tool/tester returns the correct identifier I’m looking for except gatlings jsonpath…

The tools I’ve used:

Well I removed the dot

I said that foo.[?(@)] was invalid syntax.
I never said removing just removing the dot would give you he expression
you need.

and tried the expression, which looks valid to me, "
*$.rampup.jslobs[?(@.id=='io.ox/core')].tree.folder.calendar"*

This one is syntactically valid, but still, it's not what you're looking
for.

again with different tools/testers and every tool/tester returns the
correct identifier I'm looking for except gatlings jsonpath...

Well, I've heard of cases where the majority was wrong
<https://www.youtube.com/watch?v=q2bmImPNKbM>.

*jslobs* is an object, so the *[?(@.id=='io.ox/core')]* filter should apply
to it. But guess what? It doesn't have an *id* field, so there's just no
way the filter could match something!

What you're looking for are "*all the children* of jslobs that have an id
field whose value is *io.ox/core*".
Should be pretty easy to figure out :slight_smile:

thx