1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

fix wrong type value

This commit is contained in:
Damodar Lohani 2021-05-21 13:04:19 +05:45
parent 54fdc647c2
commit 87bbcff3a7
2 changed files with 2 additions and 2 deletions

View file

@ -277,7 +277,7 @@ class OpenAPI3 extends Format
$node['schema']['x-example'] = 'password';
break;
case 'Utopia\Validator\Range': /** @var \Utopia\Validator\Range $validator */
$node['schema']['type'] = $validator->getType();
$node['type'] = $validator->getType() == Validator::TYPE_FLOAT ? 'number': $validator->getType();
$node['schema']['format'] = $validator->getType() == Validator::TYPE_INTEGER ? 'int32' : 'float';
$node['schema']['x-example'] = $validator->getMin();
break;

View file

@ -274,7 +274,7 @@ class Swagger2 extends Format
$node['x-example'] = 'password';
break;
case 'Utopia\Validator\Range': /** @var \Utopia\Validator\Range $validator */
$node['type'] = $validator->getType();
$node['type'] = $validator->getType() == Validator::TYPE_FLOAT ? 'number': $validator->getType();
$node['format'] = $validator->getType() == Validator::TYPE_INTEGER ? 'int32' : 'float';
$node['x-example'] = $validator->getMin();
break;