pact-ruby icon indicating copy to clipboard operation
pact-ruby copied to clipboard

Wildcard use with matchingRules

Open afriqs opened this issue 5 years ago • 1 comments

Hi,

I've got an EmberJS app which generates pacts. Let's say we fetch a list of articles each one with a title we do not want to verify explicitely. The (truncated) generated pact is :

"matchingRules": {
  "$.body.data[*].attributes.title": {
    "match": "type"
  }
},

When I verify with pact-ruby (v1.41.2) it seems not to understand the directive as I have the following errors :

* Expected "enim dolores nihil" but got "some text" at $.data[0].attributes.title
* Expected "quasi cupiditate temporibus" but got "some text" at $.data[1].attributes.title
* Expected "repellendus doloribus quis" but got "some text" at $.data[2].attributes.title
* Expected "asperiores non labore" but got "some text" at $.data[3].attributes.title
* Expected "quae quas consequuntur" but got "some text" at $.data[4].attributes.title

What did I miss ?

afriqs avatar Sep 10 '19 12:09 afriqs

Can you provide some executable code to recreate the issue please @afriqs. You can fork the pact-js repo and modify one of these to get something working quickly https://github.com/pact-foundation/pact-js/tree/master/examples

bethesque avatar Sep 11 '19 23:09 bethesque

difficult to diagnose without the full pact or a repro, closing due to lack of activity

YOU54F avatar Aug 07 '24 18:08 YOU54F