From e24d73b6103c358257266978e84c1edea23b8313 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 3 Apr 2026 19:05:47 +0530 Subject: [PATCH] Fix Rule response model docs and default - Fix redirectStatusCode default from 301 to 0 to match database default (null) and avoid misleading non-redirect rules - Standardize field descriptions to use consistent "Only applicable if type is X" phrasing - Fix typo in deploymentResourceId description --- src/Appwrite/Utopia/Response/Model/Rule.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Appwrite/Utopia/Response/Model/Rule.php b/src/Appwrite/Utopia/Response/Model/Rule.php index 86ac6f470e..41e84b003a 100644 --- a/src/Appwrite/Utopia/Response/Model/Rule.php +++ b/src/Appwrite/Utopia/Response/Model/Rule.php @@ -48,38 +48,38 @@ class Rule extends Model ]) ->addRule('redirectUrl', [ 'type' => self::TYPE_STRING, - 'description' => 'URL to redirect to. Used if type is "redirect"', + 'description' => 'URL to redirect to. Only applicable if type is "redirect", otherwise empty string.', 'default' => '', 'example' => 'https://appwrite.io/docs', ]) ->addRule('redirectStatusCode', [ 'type' => self::TYPE_INTEGER, - 'description' => 'Status code to apply during redirect. Used if type is "redirect"', - 'default' => 301, + 'description' => 'Status code to apply during redirect. Only applicable if type is "redirect".', + 'default' => 0, 'example' => 301, ]) ->addRule('deploymentId', [ 'type' => self::TYPE_STRING, - 'description' => 'ID of deployment. Used if type is "deployment"', + 'description' => 'ID of deployment. Only applicable if type is "deployment", otherwise empty string.', 'default' => '', 'example' => 'n3u9feiwmf', ]) ->addRule('deploymentResourceType', [ 'type' => self::TYPE_ENUM, - 'description' => 'Type of deployment. Possible values are "function", "site". Used if rule\'s type is "deployment".', + 'description' => 'Type of deployment. Possible values are "function", "site". Only applicable if type is "deployment", otherwise empty string.', 'default' => '', 'example' => 'function', 'enum' => ['function', 'site'], ]) ->addRule('deploymentResourceId', [ 'type' => self::TYPE_STRING, - 'description' => 'ID deployment\'s resource. Used if type is "deployment"', + 'description' => 'ID of deployment\'s resource. Only applicable if type is "deployment", otherwise empty string.', 'default' => '', 'example' => 'n3u9feiwmf', ]) ->addRule('deploymentVcsProviderBranch', [ 'type' => self::TYPE_STRING, - 'description' => 'Name of Git branch that updates rule. Used if type is "deployment"', + 'description' => 'Name of Git branch that updates rule. Only applicable if type is "deployment", otherwise empty string.', 'default' => '', 'example' => 'main', ])