mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +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);
|
$requirements = $this->handleRequirements($annot->requirements);
|
||||||
$data = array(
|
$data = array(
|
||||||
'required' => $annot->strict && $annot->nullable === false && $annot->default === null,
|
'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),
|
'actualType' => $this->inferType($requirements),
|
||||||
'subType' => null,
|
'subType' => null,
|
||||||
'description' => $annot->description,
|
'description' => $annot->description,
|
||||||
@ -46,19 +46,19 @@ class FosRestHandler implements HandlerInterface
|
|||||||
} elseif ($annot instanceof QueryParam) {
|
} elseif ($annot instanceof QueryParam) {
|
||||||
if ($annot->strict && $annot->nullable === false && $annot->default === null) {
|
if ($annot->strict && $annot->nullable === false && $annot->default === null) {
|
||||||
$annotation->addRequirement($annot->name, array(
|
$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' => '',
|
'dataType' => '',
|
||||||
'description' => $annot->description,
|
'description' => $annot->description,
|
||||||
));
|
));
|
||||||
} elseif ($annot->default !== null) {
|
} elseif ($annot->default !== null) {
|
||||||
$annotation->addFilter($annot->name, array(
|
$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,
|
'description' => $annot->description,
|
||||||
'default' => $annot->default,
|
'default' => $annot->default,
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
$annotation->addFilter($annot->name, array(
|
$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,
|
'description' => $annot->description,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user