propertyDescribers = $propertyDescribers; } public function describe(array $types, OA\Schema $property, array $groups = null) { $property->oneOf = Generator::UNDEFINED !== $property->oneOf ? $property->oneOf : []; foreach ($types as $type) { $property->oneOf[] = $schema = Util::createChild($property, OA\Schema::class, []); foreach ($this->propertyDescribers as $propertyDescriber) { if ($propertyDescriber instanceof ModelRegistryAwareInterface) { $propertyDescriber->setModelRegistry($this->modelRegistry); } if ($propertyDescriber->supports([$type])) { $propertyDescriber->describe([$type], $schema, $groups); break; } } } } public function supports(array $types): bool { return count($types) >= 2; } }