diff --git a/RouteDescriber/RouteMetadataDescriber.php b/RouteDescriber/RouteMetadataDescriber.php index 80dd7b8..f68dadd 100644 --- a/RouteDescriber/RouteMetadataDescriber.php +++ b/RouteDescriber/RouteMetadataDescriber.php @@ -72,6 +72,7 @@ final class RouteMetadataDescriber implements RouteDescriberInterface { /** @var OA\Parameter[] $globalParams */ $globalParams = OA\UNDEFINED !== $api->components && OA\UNDEFINED !== $api->components->parameters ? $api->components->parameters : []; + $globalParams = array_column($globalParams, null, 'parameter'); // update the indexes of the array with the reference names actually used $existingParams = []; $operationParameters = OA\UNDEFINED !== $operation->parameters ? $operation->parameters : []; diff --git a/Tests/Functional/Controller/TestController.php b/Tests/Functional/Controller/TestController.php index f1c1397..7e887e6 100644 --- a/Tests/Functional/Controller/TestController.php +++ b/Tests/Functional/Controller/TestController.php @@ -29,16 +29,4 @@ class TestController public function testAction() { } - - /** - * @OA\Parameter(ref="#/components/parameters/test"), - * @OA\Response( - * response="200", - * description="Test Ref" - * ) - * @Route("/test/{id}", methods={"GET"}) - */ - public function testRefAction() - { - } } diff --git a/Tests/Functional/FunctionalTest.php b/Tests/Functional/FunctionalTest.php index 592598c..36863a2 100644 --- a/Tests/Functional/FunctionalTest.php +++ b/Tests/Functional/FunctionalTest.php @@ -424,7 +424,8 @@ class FunctionalTest extends WebTestCase public function testNoDuplicatedParameters() { - $this->assertNotHasParameter('name', 'path', $this->getOperation('/api/article/{id}', 'get')); + $this->assertHasPath('/api/article/{id}', $this->getOpenApiDefinition()); + $this->assertNotHasParameter('id', 'path', $this->getOperation('/api/article/{id}', 'get')); } public function testSerializedNameAction()