mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
feat-whitelist-enums
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user