From 2b8214859148d44b2c243b8351b194f128ed2b91 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 18 Jan 2022 23:47:30 +1300 Subject: [PATCH] Use `$loose = true` for number param validators to allow passing strings as required by SDK's --- app/controllers/api/database.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/database.php b/app/controllers/api/database.php index a25e5e62ae..963f8fb5b7 100644 --- a/app/controllers/api/database.php +++ b/app/controllers/api/database.php @@ -943,9 +943,9 @@ App::post('/v1/database/collections/:collectionId/attributes/integer') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('min', null, new Integer(), 'Minimum value to enforce on new documents', true) - ->param('max', null, new Integer(), 'Maximum value to enforce on new documents', true) - ->param('default', null, new Integer(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('min', null, new Integer(true), 'Minimum value to enforce on new documents', true) + ->param('max', null, new Integer(true), 'Maximum value to enforce on new documents', true) + ->param('default', null, new Integer(true), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) ->param('array', false, new Boolean(), 'Is attribute an array?', true) ->inject('response') ->inject('dbForProject') @@ -1014,9 +1014,9 @@ App::post('/v1/database/collections/:collectionId/attributes/float') ->param('collectionId', '', new UID(), 'Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).') ->param('key', '', new Key(), 'Attribute Key.') ->param('required', null, new Boolean(), 'Is attribute required?') - ->param('min', null, new FloatValidator(), 'Minimum value to enforce on new documents', true) - ->param('max', null, new FloatValidator(), 'Maximum value to enforce on new documents', true) - ->param('default', null, new FloatValidator(), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) + ->param('min', null, new FloatValidator(true), 'Minimum value to enforce on new documents', true) + ->param('max', null, new FloatValidator(true), 'Maximum value to enforce on new documents', true) + ->param('default', null, new FloatValidator(true), 'Default value for attribute when not provided. Cannot be set when attribute is required.', true) ->param('array', false, new Boolean(), 'Is attribute an array?', true) ->inject('response') ->inject('dbForProject')