We’re working on using matchers using the `pactffi...
# libpact_ffi-users
f
We’re working on using matchers using the
pactffi_matches_json_value
function, and are seeing some unexpected behavior for some more advanced rules where the check passes even though it shouldn’t… For example, with an
arrayContains
matching rule, no error is returned even though an array with one element that doesn’t satisfy the matching rules is passed to it. Here’s the line in the pactffi log for the check:
Copy code
2025-03-31T15:16:12.632536Z DEBUG ThreadId(01) pact_matching::json: JSON -> JSON: Comparing '[{"baz":42,"foo":"bar"}]' to '["bla"]' using ArrayContains([(0, MatchingRuleCategory { name: BODY, rules: {DocPath { path_tokens: [Root, Field("baz")], expr: "$.baz" }: RuleList { rules: [Type], rule_logic: And, cascaded: false }} }, {})]) -> Ok(())
We’re using pactffi release 0.4.26 btw, am I missing something here? Thread in Slack Conversation
r
I'll have to investigate that,
arrayContains
is a tricky matching rule to get right
Can you raise a GitHub issue for that?
f
Sure thing
@rholshausen I’ve created an issue for it https://github.com/pact-foundation/pact-reference/issues/491