-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pact matcher for different number of elements in array #1318
Comments
What are you using to verify the pact with? That error means that the pact file is being verified as a V2 format, but the array contains matcher only works with V3 and V4 formatted pacts. |
Looks like there is an issue with the array contains matcher with simple values in the array. |
Thanks for looking into. I am using 4.2.0 for both consumer and producer which I believe follows V4 specification. |
I see that you have put in a fix for this issue, can you please let me know which release version will have this fix? Thanks. |
4.2.2 released |
array matching works in 4.2.2. |
Hi,
I have an endpoint which returns following format of response:
This service can return any number of elements in array.
I was using 4.1.17 version of pact consumer and using array for matcher but it seems that matcher requires exact number of elements to be specified in pact.
My old code:
That's the matcher in json file:
This gives me following error:
As suggested to me in my stackoverflow question that I should use arrayContaining() method which supports varying list of elements in array.
I updated my code to following after updating pact consumer version to 4.2.0:
It generates following matcher in json file:
However it gives me following error now:
Any help on this will be appreciated.
Thanks.
The text was updated successfully, but these errors were encountered: