Akash
05/10/2022, 5:55 AMblah
of type array inside an array of objects in the response body on an API like so:
[
{
"id": "10bc2494-610c-4606-b169-0c33014757e9",
"blah": [
"testing 123",
"Testing, testing, 123..."
],
"type": "GENERIC"
}
]
While I can use:
DslPart dslPart = PactDslJsonArray.arrayEachLike()
.array("blah") // Undocumented at <https://docs.pact.io/implementation_guides/jvm/consumer/junit#building-json-bodies-with-pactdsljsonbody-dsl>
.closeArray()
.closeObject()
to validate the key blah
to be an array, I can’t seem to find a way to restrict the elements of the array to be of type String. Is this possible using the DSL? I’m using au.com.dius.pact.consumer:junit:4.2.20
.rholshausen
05/10/2022, 6:51 AMeachLike
that takes a PactDslJsonRootValue
parameterrholshausen
05/10/2022, 6:53 AMAkash
05/10/2022, 6:55 AM.array("blah").stringType("testing 123").closeArray()
, which luckily works too.Akash
05/10/2022, 7:27 AM