Closed diestrin closed 7 months ago
Thanks for the test!
I don't think this is due to the skip_matchers
flag, but a bug where the values from the inner matcher are not being copied to the outer matcher. In particular, this semi-colon looks suspicious:
Software versions
Related Issue
https://github.com/pact-foundation/pact-js/issues/841
Expected behaviour
Using
array-contains
matcher should work regardless of nesting level (e.g.array-contains
including a nested property which is also matched byarray-contains
)Actual behaviour
An
array-contains
nested inside anotherarray-contains
causes the mocked server to returnnull
for the inner array.Steps to reproduce
I created a test to reproduce the bug in https://github.com/pact-foundation/pact-reference/blob/master/rust/pact_ffi/tests/tests.rs
Possible Cause
I found out the problem might be here https://github.com/pact-foundation/pact-reference/blob/master/rust/pact_ffi/src/mock_server/bodies.rs#L111 where it process the
MatchingRule::ArrayContains
and sendstrue
for theskip_matchers
flag. This makes it not process the innerarray-contains
, nor actually any other matcher I suppose.I felt tempted to submit a PR, but I am not sure if this behaviour is intended.