EachLike should allow a minimum of 0
See original GitHub issueThe EachLike
matching helper has a keyword argument minimum
that defaults to 1 and can not be lower than 1. However, many of our APIs return empty object arrays. Would it be possible to support a minimum=0
setting? Or some other flag that indicates the array can be empty?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Using Pact.eachLike() when array contents vary for each item
So is there a was to allow unexpected key/values in arrays because ... { "match": "type" } We're wondering if Pact NPM should...
Read more >Matching | Pact Docs
Behaves like the eachLike matcher, but also applies a minimum and maximum length validation on the length of the array. The optional count ......
Read more >Pact with Java (by example) - HMH Engineering
eachLike we can be asserting against multiple items coming back from the api. 5 — Array as starting point. All the examples we...
Read more >question on array matching in pact-jvm - Google Groups
"min" : 0 } } }. Obviously, the extra [ ] around the body are a problem. But the matchers also don't look...
Read more >i tried using valueBoolean MinType true 0 but 0 is not allow | Pact ...
for the same reason as above, we can't have a min of 0. If in all of the tests an empty array was...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, you can 😃 at least this is valid for me in the Go SDK
Having reflected, my comment yesterday is a bit silly, because Pact will obviously only validate the content of the attribute if it is specified, so it is not reliable. Also having read this article it makes more sense.
Haha
If it makes you feel any better: https://github.com/pact-foundation/pact-support/pull/11