pact-foundation / pact-mock_service

Provides a mock service for use with Pact
https://pact.io
MIT License
73 stars 69 forks source link

Request matching with an array in the body #25

Open abhayachauhan opened 9 years ago

abhayachauhan commented 9 years ago

We have a request which has an array at the top level of the body which I am unable to perform a type match on. For example:

        .withRequest({
            method: 'post',
            path: '/xxx/en',
            body: {
                  "json_class": "Pact::SomethingLike",
                    "contents": ["REVISION_HISTORY"]
               }
             })

This request only matches request with ["REVISION_HISTORY"] in the body and not all arrays.

bethesque commented 9 years ago

Please follow these instructions: https://github.com/realestate-com-au/pact/wiki/v2-flexible-matching

abhayachauhan commented 9 years ago

This being a pact spec v2 feature. Is PACT Mock Service PACT v2 compliant?

bethesque commented 9 years ago

Yes. If you are starting it from the command line, you'll need to give it the command line option, can't remember what it is off the top of my head, it'll be in the help output.