You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Combined Matchers - AND (implemented) or OR (to be implemented) #249
I have a question regarding matchers specified via the Pact FFI IntegrationJSON format.
Is there a way of combining matchers? From what I understand matchers can be combined in terms of "AND" and "OR" semantics. So it would be cool to specify say a bit of a response or request was both "a string" and also must be not empty. Eg, an "AND" combine of the "type" and "notEmpty" matchers.
Can this be done via the "Integration JSON" method?
changed the title [-]Question: Combine Matchers with Integration JSON[/-][+]Question: Can you combine Matchers with Integration JSON?[/+]on Jan 16, 2023
Unfortunately, the Pact FFI Integration JSON format only allows specifying a single matcher. However, as part of the plugins work we developed a matching rule expression language, which does allow multiple matchers. We could update the JSON format to support the expressions.
changed the title [-]Question: Can you combine Matchers with Integration JSON?[/-][+]Combined Matchers - AND (implemented) or OR (to be implemented)[/+]on Oct 21, 2025
Combined matcher AND is now included in the pact-core and available in some consuming library DSL's.
I will look to document examples of implementations, and feature support.
We should look to support the OR combined matcher, to be compliant with the spec, and the pact-jvm implementation.
It will help address some of the biggest faq questions, where our principles stand in the way of user need/want.
Whilst I understand it is another foot gun for the user, it unblocks a route to adoption, and get helps get the pact core in rust, and pact-jvm at parity.
Do you mind if I try to add support OR rule with Claude assistance?
Not opposed to AI contributions. I just want to to know that the contributor understands the changes and have done an appropriate level of testing themselves. What client language(s) dsl's are you looking to consume it in? and what language services to you have to interop with?
That will help us work out which wrappers to review, and a path to help you test them out locally if not already.
Activity
[-]Question: Combine Matchers with Integration JSON[/-][+]Question: Can you combine Matchers with Integration JSON?[/+]rholshausen commentedon Jan 30, 2023
Unfortunately, the Pact FFI Integration JSON format only allows specifying a single matcher. However, as part of the plugins work we developed a matching rule expression language, which does allow multiple matchers. We could update the JSON format to support the expressions.
YOU54F commentedon Jun 9, 2024
Does #405 resolve this at least for the
ANDcase[-]Question: Can you combine Matchers with Integration JSON?[/-][+]Combined Matchers - AND (implemented) or OR (to be implemented)[/+]YOU54F commentedon Oct 21, 2025
Combined matcher
ANDis now included in the pact-core and available in some consuming library DSL's.I will look to document examples of implementations, and feature support.
We should look to support the
ORcombined matcher, to be compliant with the spec, and the pact-jvm implementation.It will help address some of the biggest faq questions, where our principles stand in the way of user need/want.
Whilst I understand it is another foot gun for the user, it unblocks a route to adoption, and get helps get the pact core in rust, and pact-jvm at parity.
sergewar commentedon Jan 21, 2026
@YOU54F what do you think about using
oneOfinstead ofor?#399 (comment)
mefellows commentedon Jan 21, 2026
How does
oneOffix this issue? If only one of theoneOfs are tested, aren't you in the same place asor?sergewar commentedon Oct 20, 2026
Do you mind if I try to add support OR rule with Claude assistance?
sergewar commentedon Nov 2, 2026
Added pull request #599
YOU54F commentedon Nov 9, 2026
Not opposed to AI contributions. I just want to to know that the contributor understands the changes and have done an appropriate level of testing themselves. What client language(s) dsl's are you looking to consume it in? and what language services to you have to interop with?
That will help us work out which wrappers to review, and a path to help you test them out locally if not already.
sergewar commentedon Nov 10, 2026