Marko (IttyBittyApps / pact-swift)
01/28/2025, 3:25 AMpactffi
issue now with matchers, but...
Pact setup:
RefCell {
value: PactHandleInner {
pact: V4Pact {
consumer: Consumer { name: "Consumer" },
provider: Provider { name: "Provider" },
interactions: [
SynchronousHttp {
id: None,
key: None,
description: "an interaction with query item matcher 'includes'",
provider_states: [],
request: HttpRequest {
method: "GET",
path: "/interaction",
query: Some({"item": [Some("sub")]}),
headers: None,
body: Missing,
matching_rules: MatchingRules {
rules: {
PATH: MatchingRuleCategory { name: PATH, rules: {} },
QUERY: MatchingRuleCategory { name: QUERY, rules: {
DocPath {
path_tokens: [Root, Field("item")],
expr: "$.item"
}:
RuleList {
rules: [Include("sub")],
rule_logic: And,
cascaded: false
}
}
}
}
},
generators: Generators { categories: {} } },
response: HttpResponse {
status: 200,
headers: None,
body: Missing,
matching_rules: MatchingRules { rules: {} },
generators: Generators { categories: {} } },
comments: {},
pending: false,
plugin_config: {},
interaction_markup: InteractionMarkup { markup: "", markup_type: "" },
transport: None
}
],
metadata: {
"namespace1": Object {"name1": String("value1")},
"namespace2": Object {"name2": String("value2")},
"pactRust": Object {"ffi": String("0.4.25")}
},
plugin_data: []
},
mock_server_started: true,
specification_version: V4
}
}
Simple GET request
----------------------------------------------------------------------------------------
method: GET
path: /interaction
query: Some({"item": [Some("substring")]})
headers: Some({"accept-language": ["en-AU", "en;q=0.9"], "user-agent": ["xctest/23600 CFNetwork/1568.300.101 Darwin/24.2.0"], "host": ["127.0.0.1:4658"], "accept-encoding": ["gzip", "deflate"], "connection": ["keep-alive"], "accept": ["*/*"]})
body: Empty
----------------------------------------------------------------------------------------
Failing to verify
QueryMismatch: Unable to match ["sub"] using Include("sub")
Expected: ["sub"]
Actual: ["substring"]
Parameter: $.item])"
rholshausen
01/28/2025, 3:33 AMMarko (IttyBittyApps / pact-swift)
01/28/2025, 3:33 AMrholshausen
01/28/2025, 3:33 AMMarko (IttyBittyApps / pact-swift)
01/28/2025, 3:34 AMMarko (IttyBittyApps / pact-swift)
01/28/2025, 3:34 AMrholshausen
01/28/2025, 3:48 AMrholshausen
01/28/2025, 3:49 AMMarko (IttyBittyApps / pact-swift)
01/28/2025, 3:50 AMMarko (IttyBittyApps / pact-swift)
01/28/2025, 3:50 AMMarko (IttyBittyApps / pact-swift)
01/28/2025, 3:51 AM