Closed wolfgangcolsman closed 3 years ago
Try this: $..[?(@['@id']==1)
This changes the exception to
org.antlr.v4.runtime.misc.ParseCancellationException
at org.antlr.v4.runtime.BailErrorStrategy.recoverInline(BailErrorStrategy.java:66)
at org.antlr.v4.runtime.Parser.match(Parser.java:206)
at org.jsfr.json.compiler.JsonPathParser.filter(JsonPathParser.java:770)
at org.jsfr.json.compiler.JsonPathParser.relativePath(JsonPathParser.java:307)
at org.jsfr.json.compiler.JsonPathParser.path(JsonPathParser.java:159)
at org.jsfr.json.compiler.JsonPathCompiler.compile(JsonPathCompiler.java:283)
at org.jsfr.json.SurfingConfiguration$Builder.bind(SurfingConfiguration.java:201)
...
Caused by: org.antlr.v4.runtime.InputMismatchException
at org.antlr.v4.runtime.BailErrorStrategy.recoverInline(BailErrorStrategy.java:61)
... 32 more
Sorry, I missed a brackets: $..[?(@['@id']==1)]
Awesome. Thank you for your help
Steps to reproduce
Example JSON:
Query:
$..[?(@.@id==1)]
Code:
Expected
{"@id":1,"title":"Sayings of the Century"}
Actual
Note
The issue is the @id, which is valid format in e.g. json-ld