Skip to content

Commit 0c5126d

Browse files
authored
Merge pull request #5 from php-api-clients/make-sure-items-property-is-a-schema
Make sure items property is a schema
2 parents 329fb58 + 38fad74 commit 0c5126d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Generator/Schema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function generate(string $name, string $namespace, string $classNa
7676
)
7777
);
7878
if (is_string($property->type)) {
79-
if ($property->type === 'array' && array_key_exists(spl_object_hash($property->items), $schemaClassNameMap)) {
79+
if ($property->type === 'array' && $property->items instanceof OpenAPiSchema && array_key_exists(spl_object_hash($property->items), $schemaClassNameMap)) {
8080
$docBlock[] = '@var array<' . $namespace . '\\' . $schemaClassNameMap[spl_object_hash($property->items)] . '>';
8181
}
8282
$propertyStmt->setType(str_replace([

0 commit comments

Comments
 (0)