mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Fix FOSRestBundle compatibility
This commit is contained in:
parent
67b7b46627
commit
5541412e69
@ -33,7 +33,7 @@ class FosRestHandler implements HandlerInterface
|
||||
$requirements = $this->handleRequirements($annot->requirements);
|
||||
$data = array(
|
||||
'required' => $annot->strict && $annot->nullable === false && $annot->default === null,
|
||||
'dataType' => $requirements.($annot->array ? '[]' : ''),
|
||||
'dataType' => $requirements.((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''),
|
||||
'actualType' => $this->inferType($requirements),
|
||||
'subType' => null,
|
||||
'description' => $annot->description,
|
||||
@ -46,19 +46,19 @@ class FosRestHandler implements HandlerInterface
|
||||
} elseif ($annot instanceof QueryParam) {
|
||||
if ($annot->strict && $annot->nullable === false && $annot->default === null) {
|
||||
$annotation->addRequirement($annot->name, array(
|
||||
'requirement' => $this->handleRequirements($annot->requirements).($annot->array ? '[]' : ''),
|
||||
'requirement' => $this->handleRequirements($annot->requirements).((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''),
|
||||
'dataType' => '',
|
||||
'description' => $annot->description,
|
||||
));
|
||||
} elseif ($annot->default !== null) {
|
||||
$annotation->addFilter($annot->name, array(
|
||||
'requirement' => $this->handleRequirements($annot->requirements).($annot->array ? '[]' : ''),
|
||||
'requirement' => $this->handleRequirements($annot->requirements).((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''),
|
||||
'description' => $annot->description,
|
||||
'default' => $annot->default,
|
||||
));
|
||||
} else {
|
||||
$annotation->addFilter($annot->name, array(
|
||||
'requirement' => $this->handleRequirements($annot->requirements).($annot->array ? '[]' : ''),
|
||||
'requirement' => $this->handleRequirements($annot->requirements).((property_exists($annot, 'map') ? $annot->map : $annot->array) ? '[]' : ''),
|
||||
'description' => $annot->description,
|
||||
));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user