mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Fixed names and multi for array query params (#1509)
This commit is contained in:
parent
a3800fb29a
commit
74fcffdc37
@ -40,7 +40,8 @@ final class FosRestDescriber implements RouteDescriberInterface
|
||||
foreach ($this->getOperations($api, $route) as $operation) {
|
||||
foreach ($annotations as $annotation) {
|
||||
if ($annotation instanceof QueryParam) {
|
||||
$parameter = $operation->getParameters()->get($annotation->getName(), 'query');
|
||||
$name = $annotation->getName().($annotation->map ? '[]' : '');
|
||||
$parameter = $operation->getParameters()->get($name, 'query');
|
||||
$parameter->setAllowEmptyValue($annotation->nullable && $annotation->allowBlank);
|
||||
|
||||
$parameter->setRequired(!$annotation->nullable && $annotation->strict);
|
||||
@ -68,6 +69,7 @@ final class FosRestDescriber implements RouteDescriberInterface
|
||||
|
||||
if ($annotation->map) {
|
||||
$parameter->setType('array');
|
||||
$parameter->setCollectionFormat('multi');
|
||||
$parameter = $parameter->getItems();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user