1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

Merge pull request #2636 from appwrite/fix-db-attr-number-params

Add float validator case to spec to prevent fallthrough
This commit is contained in:
Eldad A. Fux 2022-02-01 22:57:44 +02:00 committed by GitHub
commit 3330cbc06b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 2 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -325,9 +325,14 @@ class OpenAPI3 extends Format
$node['schema']['x-example'] = $validator->getMin();
break;
case 'Utopia\Validator\Numeric':
case 'Utopia\Validator\Integer':
$node['schema']['type'] = $validator->getType();
$node['schema']['format'] = 'int32';
break;
case 'Utopia\Validator\FloatValidator':
$node['schema']['type'] = 'number';
$node['schema']['format'] = 'float';
break;
case 'Utopia\Validator\Length':
$node['schema']['type'] = $validator->getType();
break;

View file

@ -319,6 +319,10 @@ class Swagger2 extends Format
$node['type'] = $validator->getType();
$node['format'] = 'int32';
break;
case 'Utopia\Validator\FloatValidator':
$node['type'] = 'number';
$node['format'] = 'float';
break;
case 'Utopia\Validator\Length':
$node['type'] = $validator->getType();
break;