mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix: normalize multi-method route indexes
This commit is contained in:
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) {
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user