Hi all,
SailPoint has written a Json path evaluator that should be as similar as possible to the implementation used by SailPoint in each area of the UI (only workflow and event trigger implementations are supported for now).
This is great and can be useful, but I noticed during testing that it is actually not matching in behavior. Using this evaluator to convince yourself that your workflow implementation will work correctly is therefore not a working strategy.
Since the default JSON of the given evaluator does not have much data to test on (empty arrays, multivalue arrays, booleans, integers), I have tested it on this JSON object:
{
"id": "1234",
"name": "fruits",
"items": [
{
"name": "apple",
"color": "red",
"tasty": true,
"cost": 10,
"vendors": [
{
"name": "Good Fruit Hood",
"id": "A"
},
{
"name": "Steve",
"id": "B"
}
]
},
{
"name": "apple",
"color": "green",
"tasty": true,
"cost": 9,
"vendors": [
{
"name": "Good Fruit Hood",
"id": "A"
},
{
"name": "Steve",
"id": "B"
}
]
},
{
"name": "pear",
"color": "green",
"tasty": true,
"cost": 11,
"vendors": []
},
{
"name": "lemon",
"color": "yellow",
"tasty": false,
"cost": 10,
"vendors": [
{
"name": "CJ",
"id": "C"
}
]
}
]
}
Some examples I found while testing, more might exist, but it is demonstrating that they are actually not using the same implementation:
JSON path | behavior in json path evalator from SailPoint | actual behavior in workflows |
---|---|---|
$.name.length() | 6 | 8 |
$.items[?(@.name == ‘pear’)] | [{…}] | {…} |
$.items[?(@.name == ‘banana’)] | [ ] | null |
Also, I saw that the json validator is breaking on the paths below, where we do expect a value (have not compared this to workflows, but just saw it breaking):
- $.items[0].tasty
- $.items[?(@.cost == 10)] results in an array with two values, but $.items[?(@.cost == 10)][0] gives an empty array instead of the first object.
- $.items[?(@.tasty)] also returned the lemon.
Tagging @tyler_mairose in response to:
Kind regards,
Angelo