Open soullivaneuh opened 8 years ago
Is memCached
an array parameter ?
No, it's an integer.
All my NotBlank
fields are integer, float or string.
Can you provide me your form definition please?
The forms are normalized by the JMSSerializer
(https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/Handler/FormErrorHandler.php#L128).
Is your field in a child form ? Otherwise you should open an issue on https://github.com/schmittjoh/serializer to ask if this behaviour is expected.
Here my form definition:
class ServerStatType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('cpuStats')
->add('loadAvrg')
->add('memPhysFree')
->add('memPhysUsed')
->add('memSwapFree')
->add('memSwapUsed')
->add('memCached')
->add('diskUsage')
->add('networkTraffic')
;
}
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefaults([
'data_class' => ServerStat::class,
'csrf_protection' => false,
])
;
}
/**
* {@inheritdoc}
*/
public function getName()
{
return '';
}
}
All my fields have
NotBlank
constraint.If I post the field key with not value, the error is set correctly.
But if I miss completely the field on the request, the error is set but not on
children
section. Please see:Is that an issue? How to solve it?
Thanks.