Skip to content

Commit 10e8466

Browse files
author
Thibaut Cholley
committed
fix(openapi): anyOf must contains an array, not an object
1 parent 65e137f commit 10e8466

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsonSchema/Metadata/Property/Factory/SchemaPropertyMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private function getJsonSchemaFromType(Type $type, ?bool $readableLink = null):
218218
} elseif (1 === \count($schemas)) {
219219
$schema = current($schemas);
220220
} else {
221-
$schema = ['anyOf' => $schemas];
221+
$schema = ['anyOf' => array_values($schemas)];
222222
}
223223

224224
return $this->applyNullability($schema, $isNullable);

0 commit comments

Comments
 (0)