From eeeaba89cccc3fb30ada166c9ba46657c2695a10 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 20 Aug 2026 17:40:12 +0530 Subject: [PATCH] fix: emit Project.wafEnabled for SDK 27 migration client (#13293) appwrite/appwrite 27.1.0 declares wafEnabled as a required, non-nullable property on Models\Project, so deserialising a project the server does not send it for throws "Missing required field". The migration source adapter reads projects through that SDK, which takes out eight MigrationsConsoleClientTest cases. Add the rule and coerce the attribute so the field is always present. Cherry-picked from 2f152910c9 on feat-query-lib, where it is currently stranded behind #11649. Co-authored-by: Jake Barnby --- src/Appwrite/Utopia/Response/Model/Project.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Appwrite/Utopia/Response/Model/Project.php b/src/Appwrite/Utopia/Response/Model/Project.php index c4c2fe0607..c86cedbe04 100644 --- a/src/Appwrite/Utopia/Response/Model/Project.php +++ b/src/Appwrite/Utopia/Response/Model/Project.php @@ -199,6 +199,12 @@ class Project extends Model 'default' => '', 'example' => self::TYPE_DATETIME_EXAMPLE, ]) + ->addRule('wafEnabled', [ + 'type' => self::TYPE_BOOLEAN, + 'description' => 'Whether WAF enforcement is enabled for the project.', + 'default' => false, + 'example' => false, + ]) ; } @@ -234,6 +240,7 @@ class Project extends Model $this->expandProtocols($document); $this->expandAuthMethods($document); $this->expandConsoleAccessedAt($document); + $document->setAttribute('wafEnabled', (bool) $document->getAttribute('wafEnabled', false)); return $document; }