diff --git a/src/Processors/AugmentProperties.php b/src/Processors/AugmentProperties.php index 395ac8c2..68e575c0 100644 --- a/src/Processors/AugmentProperties.php +++ b/src/Processors/AugmentProperties.php @@ -51,7 +51,9 @@ public function __invoke(Analysis $analysis) if (Generator::isDefault($property->type)) { $this->augmentType($analysis, $property, $context, $refs, $typeAndDescription['type']); } else { - $this->mapNativeType($property, $property->type); + if (!is_array($property->type)) { + $this->mapNativeType($property, $property->type); + } } if (Generator::isDefault($property->description) && $typeAndDescription['description']) { @@ -129,7 +131,7 @@ protected function augmentType(Analysis $analysis, OA\Property $property, Contex if (Generator::isDefault($property->ref) && array_key_exists($refKey, $refs)) { $this->applyRef($analysis, $property, $refs[$refKey]); } else { - if ($typeSchema = $analysis->getSchemaForSource($context->type)) { + if (is_string($context->type) && $typeSchema = $analysis->getSchemaForSource($context->type)) { if (Generator::isDefault($property->format)) { $property->ref = OA\Components::ref($typeSchema); $property->type = Generator::UNDEFINED; diff --git a/src/Processors/AugmentSchemas.php b/src/Processors/AugmentSchemas.php index 47952b0c..a07b2aa3 100644 --- a/src/Processors/AugmentSchemas.php +++ b/src/Processors/AugmentSchemas.php @@ -103,7 +103,7 @@ protected function augmentType(Analysis $analysis, array $schemas): void $schema->type = 'object'; } } else { - if ($typeSchema = $analysis->getSchemaForSource($schema->type)) { + if (is_string($schema->type) && $typeSchema = $analysis->getSchemaForSource($schema->type)) { if (Generator::isDefault($schema->format)) { $schema->ref = OA\Components::ref($typeSchema); $schema->type = Generator::UNDEFINED;