From 783e9d86c0049fe06dc070078cb57f35b7c7fc74 Mon Sep 17 00:00:00 2001 From: kodumbeats Date: Fri, 27 Aug 2021 16:27:59 -0400 Subject: [PATCH] Fix response models --- src/Appwrite/Utopia/Response/Model.php | 2 +- src/Appwrite/Utopia/Response/Model/AttributeFloat.php | 8 ++++---- src/Appwrite/Utopia/Response/Model/AttributeList.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Utopia/Response/Model.php b/src/Appwrite/Utopia/Response/Model.php index 40a8825273..a763692c71 100644 --- a/src/Appwrite/Utopia/Response/Model.php +++ b/src/Appwrite/Utopia/Response/Model.php @@ -8,7 +8,7 @@ abstract class Model { const TYPE_STRING = 'string'; const TYPE_INTEGER = 'integer'; - const TYPE_FLOAT = 'float'; + const TYPE_FLOAT = 'double'; const TYPE_BOOLEAN = 'boolean'; const TYPE_JSON = 'json'; diff --git a/src/Appwrite/Utopia/Response/Model/AttributeFloat.php b/src/Appwrite/Utopia/Response/Model/AttributeFloat.php index a0f68ec6af..7c4ead9e77 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeFloat.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeFloat.php @@ -13,18 +13,18 @@ class AttributeFloat extends Attribute $this ->addRule('min', [ - 'type' => self::TYPE_INTEGER, + 'type' => self::TYPE_FLOAT, 'description' => 'Minimum value to enforce for new documents.', 'default' => null, - 'example' => 1, + 'example' => 1.5, 'array' => false, 'require' => false, ]) ->addRule('max', [ - 'type' => self::TYPE_INTEGER, + 'type' => self::TYPE_FLOAT, 'description' => 'Maximum value to enforce for new documents.', 'default' => null, - 'example' => 10, + 'example' => 10.5, 'array' => false, 'require' => false, ]) diff --git a/src/Appwrite/Utopia/Response/Model/AttributeList.php b/src/Appwrite/Utopia/Response/Model/AttributeList.php index 5484db61f1..26ea146ec8 100644 --- a/src/Appwrite/Utopia/Response/Model/AttributeList.php +++ b/src/Appwrite/Utopia/Response/Model/AttributeList.php @@ -25,7 +25,7 @@ class AttributeList extends Model 'getNestedType' => function(Document $attribute) { return match($attribute->getAttribute('type')) { self::TYPE_BOOLEAN => Response::MODEL_ATTRIBUTE_BOOLEAN, - self::TYPE_INTEGER=> Response::MODEL_ATTRIBUTE_INTEGER, + self::TYPE_INTEGER => Response::MODEL_ATTRIBUTE_INTEGER, self::TYPE_FLOAT => Response::MODEL_ATTRIBUTE_FLOAT, self::TYPE_STRING => match($attribute->getAttribute('format')) { APP_DATABASE_ATTRIBUTE_EMAIL => Response::MODEL_ATTRIBUTE_EMAIL,