Fix map support of FOSRestBundle

This commit is contained in:
Guilhem N 2019-04-20 13:18:00 +02:00 committed by GitHub
parent ccad10aae1
commit 90293e171f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,12 +58,20 @@ final class FosRestDescriber implements RouteDescriberInterface
}
$parameter->setDefault($annotation->getDefault());
if (null === $parameter->getType()) {
$parameter->setType($annotation->map ? 'array' : 'string');
if (null !== $parameter->getType()) {
continue;
}
if (null === $parameter->getDescription()) {
$parameter->setDescription($annotation->description);
}
if ($annotation->map) {
$parameter->setType('array');
$parameter = $parameter->getItems();
}
$parameter->setType('string');
$pattern = $this->getPattern($annotation->requirements);
if (null !== $pattern) {