diff --git a/src/Generator/Schema.php b/src/Generator/Schema.php index d76cb44..325f2e3 100644 --- a/src/Generator/Schema.php +++ b/src/Generator/Schema.php @@ -76,7 +76,7 @@ public static function generate(string $name, string $namespace, string $classNa ) ); if (is_string($property->type)) { - if ($property->type === 'array' && array_key_exists(spl_object_hash($property->items), $schemaClassNameMap)) { + if ($property->type === 'array' && $property->items instanceof OpenAPiSchema && array_key_exists(spl_object_hash($property->items), $schemaClassNameMap)) { $docBlock[] = '@var array<' . $namespace . '\\' . $schemaClassNameMap[spl_object_hash($property->items)] . '>'; } $propertyStmt->setType(str_replace([