I'm designing REST API with Symfony2.
For POST and PUT request i'm using a FormType. Something like :
class EmailType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('subject', 'textarea')
[...]
;
}
public function getName()
{
return 'email';
}
}
But when I POST, i'm must pass fields with a namespace like :
{
"email": {
"subject": "subject"
}
}
But I don't want this top-level namespace !
Any ideas ?