From aa1b3f3f1b0923260f6aa61948812b3d861d0c28 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 14 Jul 2026 12:57:43 +0530 Subject: [PATCH 1/3] Upgrade Messaging to 1.3.0 --- composer.json | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index 753119b058..8ef51e4f2b 100644 --- a/composer.json +++ b/composer.json @@ -82,7 +82,7 @@ "utopia-php/locale": "0.8.*", "utopia-php/lock": "0.2.*", "utopia-php/logger": "0.8.*", - "utopia-php/messaging": "^1.2", + "utopia-php/messaging": "^1.3", "utopia-php/migration": "1.17.*", "utopia-php/platform": "^1.0@RC", "utopia-php/pools": "1.*", diff --git a/composer.lock b/composer.lock index 2746d9fb17..0d89ec662e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fcea2b6684445b7b5397e017c1eff89a", + "content-hash": "188ecad278dfe1db8beef12790f11843", "packages": [ { "name": "adhocore/jwt", @@ -4459,16 +4459,16 @@ }, { "name": "utopia-php/messaging", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/utopia-php/messaging.git", - "reference": "3419ffbbeb242b3232b588430bd465024959720c" + "reference": "63a27be589fd998ad8489d66e570640c7cce9425" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/messaging/zipball/3419ffbbeb242b3232b588430bd465024959720c", - "reference": "3419ffbbeb242b3232b588430bd465024959720c", + "url": "https://api.github.com/repos/utopia-php/messaging/zipball/63a27be589fd998ad8489d66e570640c7cce9425", + "reference": "63a27be589fd998ad8489d66e570640c7cce9425", "shasum": "" }, "require": { @@ -4505,9 +4505,9 @@ ], "support": { "issues": "https://github.com/utopia-php/messaging/issues", - "source": "https://github.com/utopia-php/messaging/tree/1.2.0" + "source": "https://github.com/utopia-php/messaging/tree/1.3.0" }, - "time": "2026-06-23T04:24:43+00:00" + "time": "2026-07-14T07:21:08+00:00" }, { "name": "utopia-php/migration", From 7c47add5be7dc50553a03dedc8715c5fbb57d4a4 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 14 Jul 2026 13:34:46 +0530 Subject: [PATCH 2/3] fix: generate unique SDK names for multi-method routes --- src/Appwrite/SDK/Specification/Format/OpenAPI3.php | 11 +++++++++-- tests/unit/SDK/Specification/FormatTest.php | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 499c5c3474..ead6542848 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -833,10 +833,17 @@ class OpenAPI3 extends Format } $methods = $route->getMethods(); - foreach ($methods as $method) { + foreach ($methods as $index => $method) { $methodTemp = $temp; if (\count($methods) > 1) { - $methodTemp['operationId'] .= \ucfirst(\strtolower($method)); + $suffix = \ucfirst(\strtolower($method)); + $methodTemp['operationId'] .= $suffix; + + // Keep the first method's SDK name stable while ensuring + // additional HTTP methods generate unique SDK methods. + if ($index > 0) { + $methodTemp['x-appwrite']['method'] .= $suffix; + } } $body = [ 'content' => [ diff --git a/tests/unit/SDK/Specification/FormatTest.php b/tests/unit/SDK/Specification/FormatTest.php index 4932022c56..87f555b35a 100644 --- a/tests/unit/SDK/Specification/FormatTest.php +++ b/tests/unit/SDK/Specification/FormatTest.php @@ -188,6 +188,8 @@ final class FormatTest extends TestCase $this->assertSame('testGetOrUpdateTestGet', $get['operationId']); $this->assertSame('testGetOrUpdateTestPost', $post['operationId']); + $this->assertSame('getOrUpdateTest', $get['x-appwrite']['method']); + $this->assertSame('getOrUpdateTestPost', $post['x-appwrite']['method']); $this->assertSame('path', $get['parameters'][0]['in']); $this->assertSame('query', $get['parameters'][1]['in']); $this->assertArrayNotHasKey('requestBody', $get); From 8bf52536cedc4300fd5a2448e0a6d60901f173bd Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 14 Jul 2026 13:41:41 +0530 Subject: [PATCH 3/3] fix: normalize multi-method route indexes --- src/Appwrite/SDK/Specification/Format/OpenAPI3.php | 2 +- tests/unit/SDK/Specification/FormatTest.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index ead6542848..a308974f3e 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -832,7 +832,7 @@ class OpenAPI3 extends Format $url = \implode('/', $segments); } - $methods = $route->getMethods(); + $methods = \array_values($route->getMethods()); foreach ($methods as $index => $method) { $methodTemp = $temp; if (\count($methods) > 1) { diff --git a/tests/unit/SDK/Specification/FormatTest.php b/tests/unit/SDK/Specification/FormatTest.php index 87f555b35a..4b7edf0c28 100644 --- a/tests/unit/SDK/Specification/FormatTest.php +++ b/tests/unit/SDK/Specification/FormatTest.php @@ -168,7 +168,12 @@ final class FormatTest extends TestCase Method::$processed = []; Method::$errors = []; - $route = (new Route(['GET', 'POST'], '/v1/tests/:testId')) + $route = (new class (['GET', 'POST'], '/v1/tests/:testId') extends Route { + public function getMethods(): array + { + return [2 => 'GET', 4 => 'POST']; + } + }) ->desc('Get or update test') ->label('sdk', new Method( namespace: 'test',