Feisal Ahmad
04/01/2025, 4:22 PMpactffi_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:
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 Conversationrholshausen
04/01/2025, 10:12 PMarrayContains
is a tricky matching rule to get rightrholshausen
04/01/2025, 10:12 PMFeisal Ahmad
04/01/2025, 10:13 PMFeisal Ahmad
04/02/2025, 5:06 PM