diff --git a/src/Generator/Schema.php b/src/Generator/Schema.php index 8eb5d14..f741b87 100644 --- a/src/Generator/Schema.php +++ b/src/Generator/Schema.php @@ -97,6 +97,8 @@ public static function generate(string $name, string $namespace, string $classNa '', 'bool', ], $property->type)); + } else if (is_array($property->anyOf) && $property->anyOf[0] instanceof OpenAPiSchema && array_key_exists(spl_object_hash($property->anyOf[0]), $schemaClassNameMap)) { + $propertyStmt->setType('\\' . $namespace . '\\' . $schemaClassNameMap[spl_object_hash($property->anyOf[0])]); } if (count($docBlock) > 0) {