I need a JSON Path expression such that if obj.test.param1
has the suffix _END
then the expression should evaluate to the value of obj.test.param1
otherwise it should evaluate to the value of obj.test.param2
.
This is the expression I have-
$.obj.test.[?(@.param1=~/.*_END(/i)].param1
But this only evaluates to value of obj.test.param1