mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: openapi specification
This commit is contained in:
@@ -8,6 +8,7 @@ use Appwrite\Utopia\Response\Model;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
use Utopia\Validator;
|
||||
use Utopia\Validator\Nullable;
|
||||
|
||||
class OpenAPI3 extends Format
|
||||
{
|
||||
@@ -281,6 +282,11 @@ class OpenAPI3 extends Format
|
||||
}
|
||||
}
|
||||
|
||||
if ($validator instanceof Nullable) {
|
||||
$validator = $validator->getValidator();
|
||||
$node['schema']['x-nullable'] = true;
|
||||
}
|
||||
|
||||
switch ((!empty($validator)) ? \get_class($validator) : '') {
|
||||
case 'Utopia\Validator\Text':
|
||||
$node['schema']['type'] = $validator->getType();
|
||||
|
||||
@@ -8,6 +8,7 @@ use Appwrite\Utopia\Response\Model;
|
||||
use Utopia\Database\Helpers\Permission;
|
||||
use Utopia\Database\Helpers\Role;
|
||||
use Utopia\Validator;
|
||||
use Utopia\Validator\Nullable;
|
||||
|
||||
class Swagger2 extends Format
|
||||
{
|
||||
@@ -282,6 +283,11 @@ class Swagger2 extends Format
|
||||
}
|
||||
}
|
||||
|
||||
if ($validator instanceof Nullable) {
|
||||
$validator = $validator->getValidator();
|
||||
$node['schema']['x-nullable'] = true;
|
||||
}
|
||||
|
||||
switch ((!empty($validator)) ? \get_class($validator) : '') {
|
||||
case 'Utopia\Validator\Text':
|
||||
$node['type'] = $validator->getType();
|
||||
|
||||
Reference in New Issue
Block a user