expression is the part which is compiled, the context is the context for the evaluation.
As you can see, there is a map key with a string "1234", but you can't evaluate with a expression like the one in the expression.
You will get an
ERROR: <input>:1:5: Syntax error: mismatched input '.1234' expecting <EOF>\n | data.1234.username == \"Willie\"\n | ....^
When i prefix the number with "a" in both parts, it's working. So i think the problem is related to the map key 1234 which should be a string but seems to be evaluated as a number.
I can't change the value of 1234, because its dynamically generated nor the expression, which is a user input?
How can i resolve this?
Since 1234 is not a valid identifier it can't be used as one. If you need to use a non-identifier as an index into a map, use the index syntax instead: data['1234'].username == 'Willie'
the problem: i have the following structure:
expression is the part which is compiled, the context is the context for the evaluation. As you can see, there is a map key with a string "1234", but you can't evaluate with a expression like the one in the expression. You will get an
ERROR: <input>:1:5: Syntax error: mismatched input '.1234' expecting <EOF>\n | data.1234.username == \"Willie\"\n | ....^
When i prefix the number with "a" in both parts, it's working. So i think the problem is related to the map key 1234 which should be a string but seems to be evaluated as a number. I can't change the value of 1234, because its dynamically generated nor the expression, which is a user input? How can i resolve this?