mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Merge pull request #122 from fvilpoix/80_default_string_field
#80 - unrecognized parameters type from form are defaultly set to 'string'
This commit is contained in:
commit
c8a0115040
@ -103,10 +103,20 @@ class FormTypeParser implements ParserInterface
|
||||
* This is just a temporary workaround for don't breaking docs page in case of unsupported types
|
||||
* like the entity type https://github.com/nelmio/NelmioApiDocBundle/issues/94
|
||||
*/
|
||||
$addDefault = false;
|
||||
try {
|
||||
$subForm = $this->formFactory->create($type);
|
||||
$parameters = array_merge($parameters, $this->parseForm($subForm, $name));
|
||||
$subParameters = $this->parseForm($subForm, $name);
|
||||
if (!empty($subParameters)) {
|
||||
$parameters = array_merge($parameters, $subParameters);
|
||||
} else {
|
||||
$addDefault = true;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$addDefault = true;
|
||||
}
|
||||
|
||||
if ($addDefault) {
|
||||
$parameters[$name] = array(
|
||||
'dataType' => 'string',
|
||||
'required' => $config->getRequired(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user