Karate check if a phrase available in the response

Viewed 21

I've a response

{ errors: [
       {
        code: 123,
        reason: "this is the reason1 is dynamically generated"
     }  ,
     {
        code: 234,
        reason: "this is the reason2 for another random reason"
     }
    ...
    ...
}

Now when I validate this response I use following

...
...    
And match response.errors[*].reason contains "this is the reason"

This validation fails, because there is an equality check for complete String for every reason with the phrase mentioned in the condition. this is reason1
I tried few wild cards but didn't work either, how to do it ?

1 Answers
Related