How To Crash The JSONPath Evaluator

The JSONPath evaluator is a great tool, but I keep accidentally crashing it, and figured I’d share with the class in case the issue could be looked into.

With the example JSON provided by default when you browse to the tool, enter a JSONPath expression of $.requestedItemsStatus[*].approvalInfo[?(@.approvalDecision=='APPROVED')].approverName. This works just fine, as expected.

HOWEVER… if you then try to wrap the key approvalDecision in square brackets and single quotes… this kills the Evaluator. Put a [' in between the (@. and approvalDecision (so, ``$.requestedItemsStatus[*].approvalInfo[?(@.['approvalDecision==‘APPROVED’)].approverName`) and it falls right over.

I did this unintentionally while trying to find a solution to an unrelated issue I’m having, and figured I’d mention it.

We are actively working on a new version of the evaluator that uses the same libraries as our implementations for ETS and Workflows. It may take a few weeks, but we are hopeful that this new approach will fix a lot of the issues of accuracy.

3 Likes

We have updated the evaluator to use the exact libraries our services use. This should no longer be an issue.

2 Likes

Thank you so much! One of my favorite things recently!

1 Like