1
0
Fork 0
mirror of synced 2024-08-04 04:52:03 +12:00

feat-whitelist-enums

This commit is contained in:
Bishwajeet Parhi 2023-06-14 10:53:59 +05:30
parent f45905e545
commit 1d528d669e
2 changed files with 2 additions and 0 deletions

View file

@ -411,6 +411,7 @@ class OpenAPI3 extends Format
/** @var \Utopia\Validator\WhiteList $validator */
$node['schema']['type'] = $validator->getType();
$node['schema']['x-example'] = $validator->getList()[0];
$node['schema']['enum'] = $validator->getList();
if ($validator->getType() === 'integer') {
$node['format'] = 'int32';

View file

@ -413,6 +413,7 @@ class Swagger2 extends Format
/** @var \Utopia\Validator\WhiteList $validator */
$node['type'] = $validator->getType();
$node['x-example'] = $validator->getList()[0];
$node['enum'] = $validator->getList();
if ($validator->getType() === 'integer') {
$node['format'] = 'int32';