Compare commits

...
Author SHA1 Message Date
Chirag Aggarwal 37746aaa12 Restore redirectStatusCode description noting 301 default 2026-04-03 19:09:18 +05:30
Chirag Aggarwal c8cfab29c2 Revert redirectStatusCode default back to 301
Keep response model default aligned with the runtime fallback
in general.php for legacy/null records.
2026-04-03 19:09:09 +05:30
Chirag Aggarwal e24d73b610 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
2026-04-03 19:05:47 +05:30
+6 -6
View File
@@ -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"',
'description' => 'Status code to apply during redirect. Only applicable if type is "redirect", defaults to 301.',
'default' => 301,
'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',
])