Noor Hashem
12/05/2022, 2:24 PM/api/payments/v1/fx_rates/${some-fx-id} and want the provider to be able to verify that the ${some-fx-id} is just some random string of numbers, I know of course that there are many matchers for strings and numbers, I was just unsure of how to implement a matcher to the url path.
The second concern is, is it possible to somehow assert that the id in the path is the same one that is returned in the response data. When I send a request to that endpoint with say id of 5, then the body has a key value pair of {id: 5} and I wanted to assert that the response body's id is the one that was provided in the request url.Timothy Jones
12/05/2022, 10:44 PMTimothy Jones
12/05/2022, 10:45 PMThe second concern is, is it possible to somehow assert that the id in the path is the same one that is returned in the response data.Yes. Put it in the expectation in the Pact. Eg,
path: "/whatever/5"
body: {
id: 5,
}Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Timothy Jones
12/05/2022, 11:11 PMMatt (pactflow.io / pact-js / pact-go)
path: Matchers.regex("the regex", "/path/to/dynamic-bit")Timothy Jones
12/05/2022, 11:13 PMMatt (pactflow.io / pact-js / pact-go)
string | Matcher<string>Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)