Skip to content

Commit f583c4f

Browse files
datronjzimaf3l1x
authored andcommitted
Fix self reference on array of objects loop error
1 parent 93c4807 commit f583c4f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/OpenApi/SchemaDefinition/Entity/EntityAdapter.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ protected function getProperties(string $type): array
147147
if ($propertyType === $type) {
148148
$propertyType = 'object';
149149
}
150+
if (str_ends_with($propertyType, '[]')) {
151+
$subType = Strings::replace($propertyType, '#\\[\\]#', '');
152+
153+
if ($subType === $type) {
154+
$propertyType = 'object';
155+
}
156+
}
150157

151158
$data[$property->getName()] = $this->getMetadata($propertyType);
152159
}

0 commit comments

Comments
 (0)