Closed Maxim-Filimonov closed 5 years ago
I'm struggling to figure out how to use array matching rules. Using pack-mock_service 2.12.0
WARN: Ignoring unsupported matching rules {"match"=>"type"} for path $['body']['attachments'][*]['content'] WARN: Ignoring unsupported matching rules {"match"=>"type"} for path $['body']['attachments'][*]['name'] WARN: Ignoring unsupported matching rules {"regex"=>"(png|xml|html|json|pdf)+"} for path $['body']['attachments'][*]['contentType'] WARN: Ignoring unsupported matching rules {"match"=>"type"} for path $['body']['attachments'][*]['type']
I'm running mock server with following command:
./bin/pact-mock-service --consumer CS --provider WebHook --pact-dir ./tmp/pacts --port 52247 --pact-specification-version 2
And the actual specification is set in our JS code with the following snippet:
body: { description: "send xml", request: { path: "/", method: "POST", body: { postVersion: 2, appId: "123", appReference: "cypress 28-Nov-18 2:47:15PM", createDate: "2018-11-28 14:47:15.8170000", clientName: "Testing", storeName: "Basic", attachments: [ { type: "CS Report", name: "Report", contentType: "xml", content: "XML>>>>>><<<<<<<<<" }, ] }, matchingRules: { "$.body.appId": { match: "type" }, "$.body.appReference": { match: "type" }, "$.body.createDate": { match: "type" }, "$.body.attachments[*].content": { match: "type" }, "$.body.attachments[*].name": { match: "type" }, "$.body.attachments[*].contentType": { regex: "(png|xml|html|json|pdf)+" }, "$.body.attachments[*].type": { match: "type" }, "$.body.attachments[*].name": { match: "type" }
We have about 8 elements in our array which makes very cumbersome to specify [0], [1] and etc... especially considering that they are sharing the same schema.
Can you please recreate the issue on a fork of https://github.com/pact-foundation/pact-ruby-standalone-e2e-example
It fixed itself somehow. Not sure what have I done 😯
I'm struggling to figure out how to use array matching rules. Using pack-mock_service 2.12.0
I'm running mock server with following command:
And the actual specification is set in our JS code with the following snippet:
We have about 8 elements in our array which makes very cumbersome to specify [0], [1] and etc... especially considering that they are sharing the same schema.