diff --git a/src/OpenApi/Attributes/JsonContent.php b/src/OpenApi/Attributes/JsonContent.php index 77fe4e3..cd7b2db 100644 --- a/src/OpenApi/Attributes/JsonContent.php +++ b/src/OpenApi/Attributes/JsonContent.php @@ -18,10 +18,11 @@ public function __construct(string $schemaClass) * @var JsonSchemaInterface */ $schema = new $schemaClass(); + $examples = iterator_to_array($schema->getExamples()); parent::__construct( schema: json_encode($schema->jsonSerialize()), - example: iterator_to_array($schema->getExamples()), + example: array_shift($examples), title: $schema->getTitle(), description: $schema->getDescription(), );