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

Request matching with an array in the body

Open abhayachauhan opened this issue 10 years ago • 3 comments
trafficstars

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.

abhayachauhan avatar Aug 27 '15 13:08 abhayachauhan

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

bethesque avatar Aug 30 '15 23:08 bethesque

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

abhayachauhan avatar Sep 02 '15 02:09 abhayachauhan

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.

bethesque avatar Sep 02 '15 04:09 bethesque