Skip to content

Commit 76f7c25

Browse files
fix: include enum options for array values in OpenAPI spec
1 parent 4811b00 commit 76f7c25

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Writing/OpenAPISpecWriter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ public function generateFieldData($field): array
470470
'format' => 'binary',
471471
] : ['type' => $baseType];
472472

473+
if (!empty($field->enumValues)) {
474+
$baseItem['enum'] = $field->enumValues;
475+
}
476+
473477
$fieldData = [
474478
'type' => 'array',
475479
'description' => $field->description ?: '',

0 commit comments

Comments
 (0)