fix: deprecation inheritance on other methods with different namespace.

This commit is contained in:
Darshan
2025-07-27 19:19:14 +05:30
parent dccf64ae2e
commit c71ff3542f
2 changed files with 16 additions and 0 deletions
@@ -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) {