Prabhakar
04/06/2022, 12:35 AMDslPart requestBody = LambdaDsl.newJsonBody((o) -> {
o.array("idList", (arr)-> {
arr.numberType(6);
});
This would work if I am passing only one value. If more than value need to be in the list then I have to add something like this...
arr.numberType(6).numberType(7);
How can this be made generalized (like minArrayLike) so that one or more could be passed and contract is still validMatt (pactflow.io / pact-js / pact-go)
Prabhakar
04/06/2022, 12:51 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Prabhakar
04/06/2022, 1:05 AMBoris
04/06/2022, 1:06 AMeachLike
, minArrayLike
and maxArrayLike
open a new object, so you can't use them for primitive types.Boris
04/06/2022, 1:06 AMarr
in your example is the object for the like
, not an arrayPrabhakar
04/06/2022, 1:07 AMBoris
04/06/2022, 1:08 AMarr
gives you misleading DSL expectations 🙂Prabhakar
04/06/2022, 1:08 AMBoris
04/06/2022, 1:09 AMBoris
04/06/2022, 1:10 AMPrabhakar
04/06/2022, 1:26 AMo.minArrayLike("categoryIds", 1, PactDslJsonRootValue.numberType(7), 2);
But this would pass [7,7] to provider. Is there a way to specify actual Ids that I would like to pass to provider.Boris
04/06/2022, 1:31 AMarr.numberType(6).numberType(7);
Boris
04/06/2022, 1:32 AMeachLike
that works with primitives instead of objects 🤔uglyog
uglyog