-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Hi,
when I try to parse the json payload with a reserved keyword 'in'
expression = "in";
String jsonPayload = "{ \"in\":1}";
System.out.println("Using JSON:\n" + mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonObj));
System.out.println("expression=" + expression);
expr = Expressions.parse(expression);
an exception is thrown:
com.api.jsonata4java.expressions.ParseException: line 1:0 at [@0,0:1='in',<5>,1:0]: mismatched input 'in' expecting {'(', 'true', 'false', STRING, 'null', '[', '{', '$', '$$', '**', NUMBER, FUNCTIONID, '*', '/', '-', '%', VAR_ID, ID}
at com.api.jsonata4java.expressions.Expressions.parse(Expressions.java:113)
at com.mytest.jsonnata.Test.test2(Test.java:105)
at com.mytest.jsonnata.Test.main(Test.java:17)
line 1:0 at [@0,0:1='in',<5>,1:0]: mismatched input 'in' expecting {'(', 'true', 'false', STRING, 'null', '[', '{', '$', '$$', '**', NUMBER, FUNCTIONID, '*', '/', '-', '%', VAR_ID, ID}
Whereas when I use 'ink' instead of 'in' the test works.
I tested with version 2.5.1
Metadata
Metadata
Assignees
Labels
No labels