mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Fixed the parsing of formed defined by creating the FormBuilder directly
This commit is contained in:
parent
22dc9ae0c0
commit
378f21ec10
@ -56,7 +56,11 @@ class FormTypeParser
|
||||
|
||||
$parameters = array();
|
||||
foreach ($builder->all() as $name => $child) {
|
||||
$childBuilder = $builder->create($name, $child['type'] ?: 'text', $child['options']);
|
||||
if ($child instanceof FormBuilder) {
|
||||
$childBuilder = $child;
|
||||
} else {
|
||||
$childBuilder = $builder->create($name, $child['type'] ?: 'text', $child['options']);
|
||||
}
|
||||
|
||||
$bestType = '';
|
||||
foreach ($childBuilder->getTypes() as $type) {
|
||||
|
@ -23,6 +23,7 @@ class TestType extends AbstractType
|
||||
{
|
||||
$builder->add('a', null, array('description' => 'A nice description'));
|
||||
$builder->add('b');
|
||||
$builder->add($builder->create('c', 'checkbox'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,4 +24,6 @@ class Test
|
||||
* @Assert\Type("DateTime");
|
||||
*/
|
||||
public $b;
|
||||
|
||||
public $c;
|
||||
}
|
||||
|
@ -75,6 +75,11 @@ b:
|
||||
* type: string
|
||||
* required: true
|
||||
|
||||
c:
|
||||
|
||||
* type: boolean
|
||||
* required: true
|
||||
|
||||
|
||||
### `POST` /tests ###
|
||||
|
||||
@ -93,6 +98,11 @@ b:
|
||||
* type: string
|
||||
* required: true
|
||||
|
||||
c:
|
||||
|
||||
* type: boolean
|
||||
* required: true
|
||||
|
||||
|
||||
|
||||
# others #
|
||||
|
@ -97,6 +97,12 @@ class SimpleFormatterTest extends WebTestCase
|
||||
'required' => true,
|
||||
'description' => '',
|
||||
),
|
||||
'c' =>
|
||||
array(
|
||||
'dataType' => 'boolean',
|
||||
'required' => true,
|
||||
'description' => '',
|
||||
),
|
||||
),
|
||||
'description' => 'create test',
|
||||
),
|
||||
@ -121,6 +127,12 @@ class SimpleFormatterTest extends WebTestCase
|
||||
'required' => true,
|
||||
'description' => '',
|
||||
),
|
||||
'c' =>
|
||||
array(
|
||||
'dataType' => 'boolean',
|
||||
'required' => true,
|
||||
'description' => '',
|
||||
),
|
||||
),
|
||||
'description' => 'create test',
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user