Skip to content

Commit 485643b

Browse files
committed
Detect property schema from oneOf
1 parent 755307b commit 485643b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Generator/Schema.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ public static function generate(string $name, string $namespace, string $classNa
9797
'',
9898
'bool',
9999
], $property->type));
100+
} else if (is_array($property->anyOf) && $property->anyOf[0] instanceof OpenAPiSchema && array_key_exists(spl_object_hash($property->anyOf[0]), $schemaClassNameMap)) {
101+
$propertyStmt->setType('\\' . $namespace . '\\' . $schemaClassNameMap[spl_object_hash($property->anyOf[0])]);
100102
}
101103

102104
if (count($docBlock) > 0) {

0 commit comments

Comments
 (0)