mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Fix the detection of references in the RouteMetadataDescriber
This commit is contained in:
parent
2f8416618d
commit
e1700ba4b5
@ -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 : [];
|
||||
|
@ -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()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user