jmsシリアライザーバンドルを使用して、作業APIのフォームエラーをシリアル化します。ユーザー登録APIから、次のように作成されたフォームがあります。
/**
* Creates the form fields
*
* @param FormBuilderInterface $builder The form builder
* @param array $options The array of passed options
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('plainPassword', 'password', array('label' => 'asdasd'))
->add('name', 'text')
->add('email', 'email');
}
間違った情報を送信すると、次のようになります。
"children": {
"plainPassword": {
"errors": [
"This value should not be blank."
]
}
}
エンティティフィールドはplainPasswordなので、passwordという名前を付けて、plainPasswordフィールドに割り当てることができますか?