mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Exception handling on unsupported fields types
Since the entity (and maybe others) form field type breaks the doc generations, I've added a try{} catch{} exception handler when you try to a compatible field type in the formParser(). It's a workaround for issue https://github.com/nelmio/NelmioApiDocBundle/issues/94. Later we can add a better support for other types of fields.
This commit is contained in:
parent
f1e28bb7bb
commit
b3d628a31b
@ -96,8 +96,17 @@ class FormTypeParser implements ParserInterface
|
|||||||
if ('' === $bestType) {
|
if ('' === $bestType) {
|
||||||
if ($type = $config->getType()) {
|
if ($type = $config->getType()) {
|
||||||
if ($type = $type->getInnerType()) {
|
if ($type = $type->getInnerType()) {
|
||||||
|
try {
|
||||||
$subForm = $this->formFactory->create($type);
|
$subForm = $this->formFactory->create($type);
|
||||||
$parameters = array_merge($parameters, $this->parseForm($subForm, $name));
|
$parameters = array_merge($parameters, $this->parseForm($subForm, $name));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$parameters[$name] = array(
|
||||||
|
'dataType' => 'string',
|
||||||
|
'required' => $config->getRequired(),
|
||||||
|
'description' => $config->getAttribute('description'),
|
||||||
|
'readonly' => $config->getDisabled(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user