a couple questions about matchers on an object bas...
# pact-js
h
a couple questions about matchers on an object based on documentation match-based-on-type. First, is there anything semantically different between like matchers here
Copy code
willRespondWith: {
    status: 200,
    headers: {
      "Content-Type": "application/json; charset=utf-8",
    },
    body: {
      id: 1,
      name: string("Billy"),
      address: like({
        street: "123 Smith St",
        suburb: "Smithsville",
        postcode: 7777,
      }),
    },
  }
and
Copy code
willRespondWith: {
    status: 200,
    headers: {
      "Content-Type": "application/json; charset=utf-8",
    },
    body: {
      id: 1,
      name: string("Billy"),
      address: {
        street: like("123 Smith St"),
        suburb: like("Smithsville"),
        postcode: like(7777),
      },
    },
  }
and what would the generated matchRules look like for v3 spec?
I've noticed when I do something like this
Copy code
body: like({            
 pageSize: 20,
 pageToken: '',
 filter: {
   providerId: '',
   type: equal('FILTER_TYPE_VISIT_SUMMARIES'),
 },
}),
then the generated match rules look like
Copy code
"matchingRules": {
  "body": {
    "$": {
      "combine": "AND",
      "matchers": [
        {
          "match": "type"
        }
      ]
    },
    "$.filter.type": {
      "combine": "AND",
      "matchers": [
        {
          "match": "equality"
        }
      ]
    }
  },
so does the first rule
"$"
recursively check each attribute?
💯 1
m
yep! they are semantically equivalent. Matchers cascade
☝️ 1
h
Thanks Matt!