From 5a35f1313b6022dfb4163f0e80ab7caae5e5e085 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 26 Aug 2025 17:33:49 +0530 Subject: [PATCH] fix: version, remove boolean --- app/config/specs/open-api3-1.8.x-client.json | 4 ++-- app/config/specs/open-api3-1.8.x-console.json | 4 ++-- app/config/specs/open-api3-1.8.x-server.json | 4 ++-- app/config/specs/open-api3-latest-client.json | 4 ++-- app/config/specs/open-api3-latest-console.json | 4 ++-- app/config/specs/open-api3-latest-server.json | 4 ++-- app/config/specs/swagger2-1.8.x-client.json | 4 ++-- app/config/specs/swagger2-1.8.x-console.json | 4 ++-- app/config/specs/swagger2-1.8.x-server.json | 4 ++-- app/config/specs/swagger2-latest-client.json | 4 ++-- app/config/specs/swagger2-latest-console.json | 4 ++-- app/config/specs/swagger2-latest-server.json | 4 ++-- app/controllers/api/account.php | 4 ++-- src/Appwrite/SDK/Method.php | 8 ++++---- src/Appwrite/SDK/Specification/Format/OpenAPI3.php | 2 +- src/Appwrite/SDK/Specification/Format/Swagger2.php | 4 ++-- 16 files changed, 33 insertions(+), 33 deletions(-) diff --git a/app/config/specs/open-api3-1.8.x-client.json b/app/config/specs/open-api3-1.8.x-client.json index f8b17b590d..2ae5797aa5 100644 --- a/app/config/specs/open-api3-1.8.x-client.json +++ b/app/config/specs/open-api3-1.8.x-client.json @@ -2317,7 +2317,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2530,7 +2530,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/open-api3-1.8.x-console.json b/app/config/specs/open-api3-1.8.x-console.json index eece5ea7db..921a2e7c6a 100644 --- a/app/config/specs/open-api3-1.8.x-console.json +++ b/app/config/specs/open-api3-1.8.x-console.json @@ -2333,7 +2333,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2546,7 +2546,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/open-api3-1.8.x-server.json b/app/config/specs/open-api3-1.8.x-server.json index 20355e9710..a78fb7d74a 100644 --- a/app/config/specs/open-api3-1.8.x-server.json +++ b/app/config/specs/open-api3-1.8.x-server.json @@ -2356,7 +2356,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2434,7 +2434,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/open-api3-latest-client.json b/app/config/specs/open-api3-latest-client.json index f8b17b590d..2ae5797aa5 100644 --- a/app/config/specs/open-api3-latest-client.json +++ b/app/config/specs/open-api3-latest-client.json @@ -2317,7 +2317,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2530,7 +2530,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/open-api3-latest-console.json b/app/config/specs/open-api3-latest-console.json index eece5ea7db..921a2e7c6a 100644 --- a/app/config/specs/open-api3-latest-console.json +++ b/app/config/specs/open-api3-latest-console.json @@ -2333,7 +2333,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2546,7 +2546,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/open-api3-latest-server.json b/app/config/specs/open-api3-latest-server.json index 20355e9710..a78fb7d74a 100644 --- a/app/config/specs/open-api3-latest-server.json +++ b/app/config/specs/open-api3-latest-server.json @@ -2356,7 +2356,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2434,7 +2434,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/swagger2-1.8.x-client.json b/app/config/specs/swagger2-1.8.x-client.json index 053bf87387..e14b8f2db7 100644 --- a/app/config/specs/swagger2-1.8.x-client.json +++ b/app/config/specs/swagger2-1.8.x-client.json @@ -2425,7 +2425,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2639,7 +2639,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/swagger2-1.8.x-console.json b/app/config/specs/swagger2-1.8.x-console.json index 76f810bf49..786dc6c586 100644 --- a/app/config/specs/swagger2-1.8.x-console.json +++ b/app/config/specs/swagger2-1.8.x-console.json @@ -2451,7 +2451,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2665,7 +2665,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/swagger2-1.8.x-server.json b/app/config/specs/swagger2-1.8.x-server.json index 3ef33e30ee..55b0acc255 100644 --- a/app/config/specs/swagger2-1.8.x-server.json +++ b/app/config/specs/swagger2-1.8.x-server.json @@ -2473,7 +2473,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2555,7 +2555,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/swagger2-latest-client.json b/app/config/specs/swagger2-latest-client.json index 053bf87387..e14b8f2db7 100644 --- a/app/config/specs/swagger2-latest-client.json +++ b/app/config/specs/swagger2-latest-client.json @@ -2425,7 +2425,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2639,7 +2639,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/swagger2-latest-console.json b/app/config/specs/swagger2-latest-console.json index 76f810bf49..786dc6c586 100644 --- a/app/config/specs/swagger2-latest-console.json +++ b/app/config/specs/swagger2-latest-console.json @@ -2451,7 +2451,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2665,7 +2665,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/config/specs/swagger2-latest-server.json b/app/config/specs/swagger2-latest-server.json index 3ef33e30ee..55b0acc255 100644 --- a/app/config/specs/swagger2-latest-server.json +++ b/app/config/specs/swagger2-latest-server.json @@ -2473,7 +2473,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { @@ -2555,7 +2555,7 @@ ], "packaging": false, "deprecated": { - "since": "0.16.0", + "since": "1.6.0", "replaceWith": "account.createSession" }, "auth": { diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 7265d2910c..24cc116aed 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -2420,7 +2420,7 @@ App::put('/v1/account/sessions/magic-url') ], contentType: ContentType::JSON, deprecated: new Deprecated( - since: '0.16.0', + since: '1.6.0', replaceWith: 'account.createSession' ), )) @@ -2461,7 +2461,7 @@ App::put('/v1/account/sessions/phone') ], contentType: ContentType::JSON, deprecated: new Deprecated( - since: '0.16.0', + since: '1.6.0', replaceWith: 'account.createSession' ), )) diff --git a/src/Appwrite/SDK/Method.php b/src/Appwrite/SDK/Method.php index 77e3e1f1af..8d11b07198 100644 --- a/src/Appwrite/SDK/Method.php +++ b/src/Appwrite/SDK/Method.php @@ -24,7 +24,7 @@ class Method * @param array $responses * @param ContentType $contentType * @param MethodType|null $type - * @param bool|Deprecated $deprecated + * @param Deprecated|null $deprecated * @param array|bool $hide * @param bool $packaging * @param ContentType $requestType @@ -41,7 +41,7 @@ class Method protected array $responses, protected ContentType $contentType = ContentType::JSON, protected ?MethodType $type = null, - protected bool|Deprecated $deprecated = false, + protected ?Deprecated $deprecated = null, protected array|bool $hide = false, protected bool $packaging = false, protected ContentType $requestType = ContentType::JSON, @@ -185,10 +185,10 @@ class Method public function isDeprecated(): bool { - return $this->deprecated !== false; + return $this->deprecated !== null; } - public function getDeprecated(): bool|Deprecated + public function getDeprecated(): ?Deprecated { return $this->deprecated; } diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index 4bc8093187..8a50ba0246 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -226,7 +226,7 @@ class OpenAPI3 extends Format ]; // add deprecation only if method has it! - if ($methodObj->getDeprecated() instanceof Deprecated) { + if ($methodObj->getDeprecated()) { $additionalMethod['deprecated'] = [ 'since' => $methodObj->getDeprecated()->getSince(), 'replaceWith' => $methodObj->getDeprecated()->getReplaceWith(), diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 225ede4f00..6ee3bcd40f 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -171,7 +171,7 @@ class Swagger2 extends Format ], ]; - if ($sdk->getDeprecated() instanceof Deprecated) { + if ($sdk->getDeprecated()) { $temp['x-appwrite']['deprecated'] = [ 'since' => $sdk->getDeprecated()->getSince(), 'replaceWith' => $sdk->getDeprecated()->getReplaceWith(), @@ -235,7 +235,7 @@ class Swagger2 extends Format ]; // add deprecation only if method has it! - if ($methodObj->getDeprecated() instanceof Deprecated) { + if ($methodObj->getDeprecated()) { $additionalMethod['deprecated'] = [ 'since' => $methodObj->getDeprecated()->getSince(), 'replaceWith' => $methodObj->getDeprecated()->getReplaceWith(),