Are there any matcher limitations for query parame...
# libpact_ffi-users
m
Are there any matcher limitations for query parameters? I'm setting up a test for PactSwift implementation verifying interactions with query parameters where I'm sending (as per docs for the FFI method):
Copy code
"{\"value\":\"12:12\",\"pact:matcher:type\":\"time\",\"format\":\"HH:mm\"}"
Into
pactffi_with_query_parameter_v2
When sent
GET  /interaction?value=10:12
pactffi
is complaining with:
Copy code
{
  "Request-Mismatch": {
    "method": "GET",
    "path": "/interaction",
    "query": {
      "item": ["10:12"]
    },
    "headers": {
      "host": ["127.0.0.1:5772"],
      "accept-language": ["en-AU", "en;q=0.9"],
      "connection": ["keep-alive"],
      "user-agent": ["xctest/23600 CFNetwork/1568.300.101 Darwin/24.2.0"],
      "accept-encoding": ["gzip", "deflate"],
      "accept": ["*/*"]},
      "body": "Empty",
      "matching_rules": { "rules": {} },    # ?????
      "generators": { "categories": {} }
    }
}
because
matching_rules
is missing the matcher value I sent through to FFI. Both
.v3
and
.v4
Coming back to this after a very long time time away, so I'm a bit rusty (no pun intended).
r
Sir! Long time!
There should not be any difference with how matchers on query parameters are handled
m
👋 hmm… I’ll dig deeper then, thanks.
r
Check the debug logs if you can
g
no idea what I'm doing
m
I have debug logs… lots of logs… amazing logs… can’t be bothered reading
anyway, picked it up again after almost a year not touching it, a huuuuge refactor and changed DSL so… still chasing my own tail here
Copy code
2025-01-27T22:22:54.111138Z DEBUG tokio-runtime-worker pact_matching: --> Mismatches: [QueryMismatch { parameter: "$.item", expected: "[\"12:12\"]", actual: "[\"10:12\"]", mismatch: "Unable to match [\"12:12\"] using Time(\"HH:mm\")" }]
This one confuses me, 'cause I do see the matcher being set
RuleList { rules: [Time("HH:mm")], rule_logic: And, cascaded: false }}
but then it fails with query mismatch 😐 when verifying
I mean...
Copy code
Request did not match: Request did not match - HTTP Request ( method: GET, path: /interaction, query: Some({"item": [Some("12:12")]}), headers: None, body: Missing )    0) Unable to match ["12:12"] using Time("HH:mm")
A bit rude tbh
r
That is rude.
I mean, that does look like a very timely value.
I think it is a bug with that matcher, it doesn't like time without seconds
m
oh cheeky cheeky
want me to raise an issue on github?
r
Yeah, that would be great
m