Tien Vo
10/23/2023, 1:31 AMTien Vo
10/23/2023, 1:50 AM```
pactffi_with_query_parameter_v2($interactionId, 'pages', 0, '{"value":"1","regex":"\\d+","pact:matcher:type":"regex"}');
```
Tien Vo
10/23/2023, 1:51 AM?pages=2&pages=3
Tien Vo
10/23/2023, 1:51 AM2023-10-23T01:46:59.767978Z DEBUG tokio-runtime-worker pact_matching: matching_rules: MatchingRules { rules: {QUERY: MatchingRuleCategory { name: QUERY, rules: {DocPath { path_tokens: [Root, Field("pages"), Index(0)], expr: "$.pages[0]" }: RuleList { rules: [Regex("\\d+")], rule_logic: And, cascaded: false }} }} }
Tien Vo
10/23/2023, 1:51 AM2023-10-23T01:46:59.768473Z DEBUG tokio-runtime-worker pact_matching: --> Mismatches: [QueryMismatch { parameter: "pages", expected: "", actual: "3", mismatch: "Expected query parameter 'pages' with value '' but was '3'" }, QueryMismatch { parameter: "pages", expected: "[\"1\"]", actual: "[\"2\", \"3\"]", mismatch: "Expected query parameter 'pages' with 1 value(s) but received 2 value(s)" }]
Tien Vo
10/23/2023, 1:53 AMpages
are integer, not the first value.
But I think there are no way to make pactffi_with_query_parameter_v2
ignore the index 0
,just like how pactffi_with_header_v2
did:
NOTE: If you pass in a form with multiple values, the index will be ignored.
rholshausen
10/23/2023, 10:13 PMexpr: "$.pages[0]"
, there is no way with the FFI params to specify *
instead of 0Tien Vo
10/24/2023, 1:45 AMpactffi_with_query_parameter_v2
to allow something like this (change value from string to array):
pactffi_with_query_parameter_v2($interactionId, 'pages', 0, '{"value":["1", "2", ["3"]],"regex":"\\d+","pact:matcher:type":"regex"}');
then it ignore the index 0
rholshausen
10/24/2023, 3:34 AMTien Vo
10/24/2023, 3:36 AMTien Vo
10/24/2023, 3:50 AMrholshausen
10/24/2023, 3:51 AM