Kusuma Guntamadugu
02/25/2025, 4:15 AMval pactBody = PactDslJsonBody()
.stringMatcher("test", "^(test1|test2)$")Matt (pactflow.io / pact-js / pact-go)
Kusuma Guntamadugu
02/25/2025, 8:17 PM"tests": [{
"test_type": "test1",
"tests": [{
"test_type": "test2",
"test": {
"test_type": "test3",
"tests": [{
"test_type": "test4",
"image": {
"assetId": "runway_brand_flying_roo_platinum"
}
}
}
}rholshausen
02/25/2025, 10:20 PMKusuma Guntamadugu
02/25/2025, 10:30 PMMatt (pactflow.io / pact-js / pact-go)
We have a complicated response where in objects are nested and hence can’t really verify the entire response confirms to a particular contractIt must have some shape, otherwise how does the client know how to parse it? If you were to describe it as OAS or JSON schema, is that possible?
Kusuma Guntamadugu
02/26/2025, 12:40 AMtests* [Test{
isConsistent* boolean
id$regression_tests string
}]Matt (pactflow.io / pact-js / pact-go)
Kusuma Guntamadugu
02/26/2025, 6:49 AMKusuma Guntamadugu
02/26/2025, 6:54 AMMatt (pactflow.io / pact-js / pact-go)
test_type as a property, but the way you framed it is that it could appear anywhere in the response at any level - this feels very “loose” and I don’t think Pact would be able to support it.
If it is a structured object, then it’s probably testable. So I was just trying to understand the model.
I don’t know this syntax, so would just be guessing what it is:
tests* [Test{
isConsistent* boolean
id$regression_tests string
}]
I think it might be something like this:
{
"tests": [
{
"isConsistent": true,
"id$regression_tests": "some string"
},
{
"isConsistent": true,
"id$regression_tests": "some other string"
}
]
}
If this structure, you could apply a constraint to id$regression_tests in the way you’re describing.