mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: response model with nullable defaults
This commit is contained in:
@@ -396,7 +396,7 @@ class Response extends SwooleResponse
|
||||
|
||||
foreach ($model->getRules() as $key => $rule) {
|
||||
if (!$document->isSet($key) && $rule['required']) { // do not set attribute in response if not required
|
||||
if (!is_null($rule['default'])) {
|
||||
if (\array_key_exists('default', $rule)) {
|
||||
$document->setAttribute($key, $rule['default']);
|
||||
} else {
|
||||
throw new Exception('Model ' . $model->getName() . ' is missing response key: ' . $key);
|
||||
|
||||
Reference in New Issue
Block a user