I wonder if it's possible to define some custom JsonType
for validation API responses through seeResponseMatchesJsonType
method. I mean, let's suppose I have response with a structure:
[
'id' => 'integer',
'name' => 'string',
'address' => [
'street' => 'string',
'city' => 'string'
]
]
Obviously this structure has complex type address
embedded and in the whole app such type might be used several times so I would like to write simply:
$I->seeResponseMatchesJsonType([
'id' => 'integer',
'name' => 'string',
'address' => 'addressType'
]);
Without rewriting this embedded structure all the time. How can I achieve it in Codeception?