This message was deleted.
# help
s
This message was deleted.
t
Hi @Biswajit Shaw, If you want logical OR you need something along the lines of:
Copy code
"bodyPatterns": [
    {
      "or": [
        {
          "matchesJsonPath": "[?(!(@.product.group))]"
        },
        {
          "matchesJsonPath": "[?(!(@.appointment.id))]"
        }
      ]
    }
  ]
b
Oh thank you 🙂 works like a charm do you need help with adding this to the documentation ? maybe i can submit a pull request
t
It’s documented here, albeit fairly briefly: https://wiremock.org/docs/request-matching/#logical-and-and-or
b
is it possible to have a logical AND/OR operator inside query parameter like match the request if any of the query parameter is present
Copy code
"queryParameters": {
      "or": {
        "limit": {
          "and": [
            {
              "matches": "^.+$"
            },
            {
              "doesNotMatch": "[0-9]+"
            }
          ]
        },
        "offset": {
          "and": [
            {
              "matches": "^.+$"
            },
            {
              "doesNotMatch": "[0-9]+"
            }
          ]
        }
t
Unfortunately not, the query parameter names must come directly under
queryParameters
, then under each of those you can nest matchers as deeply as you like.