feat-whitelist-enums
This commit is contained in:
parent
f45905e545
commit
1d528d669e
2 changed files with 2 additions and 0 deletions
|
@ -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';
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue