mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Fallback to text when no type is present
This commit is contained in:
parent
15d56360f3
commit
12f65fed4f
@ -56,10 +56,10 @@ class FormTypeParser
|
||||
|
||||
$parameters = array();
|
||||
foreach ($builder->all() as $name => $child) {
|
||||
$b = $builder->create($name, $child['type'], $child['options']);
|
||||
$childBuilder = $builder->create($name, $child['type'] ?: 'text', $child['options']);
|
||||
|
||||
$bestType = '';
|
||||
foreach ($b->getTypes() as $type) {
|
||||
foreach ($childBuilder->getTypes() as $type) {
|
||||
if (isset($this->mapTypes[$type->getName()])) {
|
||||
$bestType = $this->mapTypes[$type->getName()];
|
||||
}
|
||||
@ -67,8 +67,8 @@ class FormTypeParser
|
||||
|
||||
$parameters[$name] = array(
|
||||
'dataType' => $bestType,
|
||||
'required' => $b->getRequired(),
|
||||
'description' => $b->getAttribute('description'),
|
||||
'required' => $childBuilder->getRequired(),
|
||||
'description' => $childBuilder->getAttribute('description'),
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user