mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: deprecation inheritance on other methods with different namespace.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user