mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Support references to config parameters
This commit is contained in:
parent
9adca90e45
commit
c1fb7abfb8
@ -84,6 +84,9 @@ final class SwaggerPhpDescriber implements ModelRegistryAwareInterface
|
|||||||
if (0 === strpos($ref, '#/definitions/') && $this->api->getDefinitions()->has(substr($ref, 14))) {
|
if (0 === strpos($ref, '#/definitions/') && $this->api->getDefinitions()->has(substr($ref, 14))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (0 === strpos($ref, '#/parameters/') && isset($this->api->getParameters()[substr($ref, 13)])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
parent::ref($ref);
|
parent::ref($ref);
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ class ApiController
|
|||||||
* description="Success",
|
* description="Success",
|
||||||
* @SWG\Schema(ref=@Model(type=Article::class, groups={"light"}))
|
* @SWG\Schema(ref=@Model(type=Article::class, groups={"light"}))
|
||||||
* )
|
* )
|
||||||
|
* @SWG\Parameter(ref="#/parameters/test")
|
||||||
* @Route("/article/{id}", methods={"GET"})
|
* @Route("/article/{id}", methods={"GET"})
|
||||||
*/
|
*/
|
||||||
public function fetchArticleAction()
|
public function fetchArticleAction()
|
||||||
|
@ -126,6 +126,13 @@ class TestKernel extends Kernel
|
|||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'parameters' => [
|
||||||
|
'test' => [
|
||||||
|
'name' => 'id',
|
||||||
|
'in' => 'path',
|
||||||
|
'required' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'areas' => [
|
'areas' => [
|
||||||
'default' => ['path_patterns' => ['^/api(?!/admin)'], 'host_patterns' => ['^api\.']],
|
'default' => ['path_patterns' => ['^/api(?!/admin)'], 'host_patterns' => ['^api\.']],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user