Skip to content

Commit

Permalink
Fix issue with JSON paths contain trailing .
Browse files Browse the repository at this point in the history
  • Loading branch information
rosensilva committed Sep 13, 2023
1 parent 21d3522 commit b3bd01b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ public SynapseJsonPath(String jsonPathExpression) throws JaxenException {
propertyExpression = extractPropMatcher.group(0);
}
} else {
String expressionForCompilation = expression;
// Though SynapseJsonPath support "$.", the JSONPath implementation does not support it
if (expression.endsWith(".")) {
expression = expression.substring(0, expression.length() - 1);
expressionForCompilation = expression.substring(0, expression.length() - 1);
}
jsonPath = JsonPath.compile(expression);
jsonPath = JsonPath.compile(expressionForCompilation);
checkIsWholeBody();
}
this.setPathType(SynapsePath.JSON_PATH);
Expand Down

0 comments on commit b3bd01b

Please sign in to comment.