Yair Shkedi
07/29/2022, 1:17 PM[{ l1: fields[{k1, v1}] ,
l2: fields[]}
In other words, what about the case of API that has children that has attrbiute as value with array type, but some of the array could be an empty array, I think this is a common case
saw this post as well
https://stackoverflow.com/questions/61772433/how-to-verify-pact-when-data-returns-items-with-or-without-children-filled-in-o
and I understood the issue if min value would be 0, but from the other case, i think it is a common case that couldn’t be checked
2 -
How can I verify a request with a dynamic id (url param). I looked into the documentation, and didn’t see a way to do that.
For example, I have an api that generate some request and the response is the id, then I want to call to a get request, by the id (the id is a url param) (the id is created dynamically)Timothy Jones
07/29/2022, 2:06 PMTimothy Jones
07/29/2022, 2:06 PMTimothy Jones
07/29/2022, 2:07 PMTimothy Jones
07/29/2022, 2:08 PMTimothy Jones
07/29/2022, 2:11 PMfromProviderState
Remember that in a pact test, each interaction is independent - you use provider state to set any preconditions.Yair Shkedi
07/31/2022, 5:58 AMYair Shkedi
07/31/2022, 5:59 AMYair Shkedi
08/07/2022, 4:36 PMTimothy Jones
08/07/2022, 9:41 PMdavT
09/08/2022, 12:18 PMTimothy Jones
09/08/2022, 12:29 PMTimothy Jones
09/08/2022, 12:30 PM{
optionalArray: either([], { /* some object */ })
}
then { optionalArray: [] }
passes that test every single timeTimothy Jones
09/08/2022, 12:30 PMTimothy Jones
09/08/2022, 12:31 PMTimothy Jones
09/08/2022, 12:32 PMstate: "no arrays"
GET /arrays
responds with { optionalArray: [] }
and
state: "some arrays"
GET /arrays
responds with { optionalArray: eachLike( { /* some object */ } ) }
Timothy Jones
09/08/2022, 12:33 PMTimothy Jones
09/08/2022, 12:33 PMTimothy Jones
09/08/2022, 12:33 PMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
'
but can’t 😆 . I think I might be in a late digital-era Saw movie……)