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
So every entry that I have given is expected and is matched by their value. When I have a longer actual array than, my verification will fail. When my values change, my verification will fail.
I have also seen eachLike and minArrayLike which solve some of the issues. But then there are other issues:
-> then integerType needs a field "names". But I don't want these integers to have key.
Anyways, there is also arr.integerType() which doesn't take a parameter. But still, when the array will be generated, it will look like this:
"months": [
{
}
],
-> an object is expected. That why the verification will fail when actually receiving integers.
Same goes for eachLike. Here are also objects expected.
Thanks for reading.
The text was updated successfully, but these errors were encountered:
Unfortunately, this doesn't seem to work:
"Type mismatch: inferred type is PactDslJsonRootValue but Consumer<LambdaDslObject!>! was expected"
is what I get.
Oh, sorry, for minArrayLike it is minArrayLike(String name, Integer size, PactDslJsonRootValue value, int numberExamples) so minArrayLike("months", 1, PactDslJsonRootValue.integerType(10), 1)
(android, kotlin and library: au.com.dius.pact" version "4.3.10")
Hello,
I have certain type of json format I want to verify:
The array can be of any size and I want to verify that any value inside is of type Integer.
So I started with something like:
While the generated array looks correct, the matching rules look like this:
So every entry that I have given is expected and is matched by their value. When I have a longer actual array than, my verification will fail. When my values change, my verification will fail.
I have also seen eachLike and minArrayLike which solve some of the issues. But then there are other issues:
-> then integerType needs a field "names". But I don't want these integers to have key.
Anyways, there is also
arr.integerType()
which doesn't take a parameter. But still, when the array will be generated, it will look like this:-> an object is expected. That why the verification will fail when actually receiving integers.
Same goes for eachLike. Here are also objects expected.
Thanks for reading.
The text was updated successfully, but these errors were encountered: