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.