-
Bug
-
Resolution: Done
-
Minor
-
1.22.0.Final
-
None
-
False
-
None
-
False
-
---
-
---
-
2022 Week 20-22 (from May 16)
When JsonPathExpression#eval method is called with a JsonNode context that defines properties SECRET or WORKFLOW (which are reserved keywords) then following exception occurs for the "Recursive descent" operator (https://github.com/json-path/JsonPath#operators):
..property
java.lang.ClassCastException: class org.kie.kogito.expr.jsonpath.WorkflowJacksonJsonNodeJsonProvider$$Lambda$399/0x00000008002fd440 cannot be cast to class com.fasterxml.jackson.databind.node.ObjectNode (org.kie.kogito.expr.jsonpath.WorkflowJacksonJsonNodeJsonProvider$$Lambda$399/0x00000008002fd440 and com.fasterxml.jackson.databind.node.ObjectNode are in unnamed module of loader 'app') at com.jayway.jsonpath.spi.json.JacksonJsonNodeJsonProvider.toJsonObject(JacksonJsonNodeJsonProvider.java:247) at com.jayway.jsonpath.spi.json.JacksonJsonNodeJsonProvider.getPropertyKeys(JacksonJsonNodeJsonProvider.java:196) at com.jayway.jsonpath.internal.path.ScanPathToken$PropertyPathTokenPredicate.matches(ScanPathToken.java:202) at com.jayway.jsonpath.internal.path.ScanPathToken.walkObject(ScanPathToken.java:75) at com.jayway.jsonpath.internal.path.ScanPathToken.walk(ScanPathToken.java:41) at com.jayway.jsonpath.internal.path.ScanPathToken.walkObject(ScanPathToken.java:84) at com.jayway.jsonpath.internal.path.ScanPathToken.walk(ScanPathToken.java:41) at com.jayway.jsonpath.internal.path.ScanPathToken.evaluate(ScanPathToken.java:36) at com.jayway.jsonpath.internal.path.RootPathToken.evaluate(RootPathToken.java:62) at com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:99) at com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:107) at com.jayway.jsonpath.JsonPath.read(JsonPath.java:185) at com.jayway.jsonpath.internal.JsonContext.read(JsonContext.java:89) at com.jayway.jsonpath.internal.JsonContext.read(JsonContext.java:78) at org.kie.kogito.expr.jsonpath.JsonPathExpression.eval(JsonPathExpression.java:68) at org.kie.kogito.expr.jsonpath.JsonPathExpression.eval(JsonPathExpression.java:99) at org.kie.kogito.expr.jsonpath.JsonPathExpressionHandlerTest.testCollectFromArrayJsonNodeRecursive(JsonPathExpressionHandlerTest.java:116) ...
The reproducing test case is added as part of KOGITO-7127, but disabled for now. Needs to be enabled as part of the fix.
- relates to
-
KOGITO-7127 kogito-serverless-workflow-utils: Extend tests for ExpressionHandlerUtils
- Resolved