Body pattern matching json path with logical operators

2,147 views
Skip to first unread message

Saikat S

unread,
Sep 1, 2021, 2:07:56 PM9/1/21
to wiremock-user
Hello,

I am trying to match the request based on the JSON body with path matchers as shown below but it seems that logical operators are not supported. Is the understanding correct? What's a possible solution, in this case? Any help will be appreciated, thanks!

"bodyPatterns": [
{
"matchesJsonPath": "$[?(@.mcode == '123')]"
},
{
"matchesJsonPath": "$[?(@.pcurr == '840')]"
},
{
"matchesJsonPath": "$[?(@.amount < '200000')]"
}
]



Tom Akehurst

unread,
Sep 9, 2021, 8:58:55 AM9/9/21
to wiremock-user
This might be what you're looking for: http://wiremock.org/docs/request-matching/#logical-and-and-or
Reply all
Reply to author
Forward
0 new messages