<How does "hasExactly" keyword work in WireMocj JS...
# stackoverflow
r
How does "hasExactly" keyword work in WireMocj JSON Stub configuration? I have a JSON stub configuration as below - { "mappings": [ { "request": { "method": "GET", "url": "/student", "headers": { "X-Request-ID": { "hasExactly": [ { "equalTo": "Demo1" }, { "contains": "Demo2" }, { "doesNotContain": "Demo3" } ] } } }, "response": {...
a
@Tom Checking this one out and it seems like this is just the behavior? That the checks are essentially that the size == size of the array and that any of the values passed in meet the criteria? So for example…
Copy code
"queryParameters" : {
          "id" : {
            "hasExactly" : [
                {
                  "equalTo": "1"
                },
                {
                  "contains": "2"
                },
                {
                  "doesNotContain": "3"
                }
              ]
          }
        }
Matches on
id=1&id=2&id=3
because id=1 satisfies
equalTo: 1
, id=2 satisfies
contains: 2
, and id=1 or id=2 satisfies
doesNotContain: 3
?
t
Yes, I think your understanding is correct.
👍 1