diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 6601a36075..5b7ac04db2 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -590,6 +590,10 @@ class Response extends SwooleResponse } } + if(!$data->isSet($key) && !$rule['required']) { // skip attribute in response if not required and values does not exist + continue; + } + if ($rule['array']) { if (!is_array($data[$key])) { throw new Exception($key . ' must be an array of type ' . $rule['type']);