Php codeception seeResponseMatchesJsonType允许空数组
我想检查json结构是否与以下内容匹配:Php codeception seeResponseMatchesJsonType允许空数组,php,codeception,Php,Codeception,我想检查json结构是否与以下内容匹配: $I->seeResponseMatchesJsonType([ 'user' => [ 'id' => 'string', 'name' => 'string', 'avatar' => 'string' ]); 但是,如果用户为null,它也应该接受。它适用于基本类型: $I-
$I->seeResponseMatchesJsonType([
'user' => [
'id' => 'string',
'name' => 'string',
'avatar' => 'string'
]);
但是,如果用户为null,它也应该接受。它适用于基本类型:
$I->seeResponseMatchesJsonType([
'user' => 'null|string'
]);
但是如何使用嵌套数组来实现这一点呢