fix: normalize multi-method route indexes

This commit is contained in:
Chirag Aggarwal committed 2026-07-14 13:41:41 +05:30
1 parent 7c47add5be
commit 8bf52536ce
2 files changed
+7 -2

No files matched your search

@@ -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) {
+6 -1
View File
@@ -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',