diff --git a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php index a9991d7b03..98c33b8ae0 100644 --- a/src/Appwrite/SDK/Specification/Format/OpenAPI3.php +++ b/src/Appwrite/SDK/Specification/Format/OpenAPI3.php @@ -223,6 +223,14 @@ class OpenAPI3 extends Format 'description' => ($desc) ? \file_get_contents($desc) : '', ]; + // add deprecation only if method has it! + if ($methodObj->getDeprecated() instanceof Deprecated) { + $additionalMethod['deprecated'] = [ + 'since' => $methodObj->getDeprecated()->getSince(), + 'replaceWith' => $methodObj->getDeprecated()->getReplaceWith(), + ]; + } + // If additional method has no parameters, inherit from route if (empty($methodObj->getParameters())) { foreach ($route->getParams() as $name => $param) { diff --git a/src/Appwrite/SDK/Specification/Format/Swagger2.php b/src/Appwrite/SDK/Specification/Format/Swagger2.php index 305a10b34b..96f7b96f06 100644 --- a/src/Appwrite/SDK/Specification/Format/Swagger2.php +++ b/src/Appwrite/SDK/Specification/Format/Swagger2.php @@ -232,6 +232,14 @@ class Swagger2 extends Format 'description' => ($desc) ? \file_get_contents($desc) : '', ]; + // add deprecation only if method has it! + if ($methodObj->getDeprecated() instanceof Deprecated) { + $additionalMethod['deprecated'] = [ + 'since' => $methodObj->getDeprecated()->getSince(), + 'replaceWith' => $methodObj->getDeprecated()->getReplaceWith(), + ]; + } + // If additional method has no parameters, inherit from route if (empty($methodObj->getParameters())) { foreach ($route->getParams() as $name => $param) {