I need some validation for array attributes in my ParamFetcher params:
Example:
/**
* @RequestParam(name="client[name]", strict=true, requirements="...")
* @RequestParam(name="client[phone]", strict=true, requirements="...")
*/
public function createAction(ParamFetcherInterface $paramFetcher)
{
//...
}
How I can do this? Maybe you have alternative ways to do this? Using ParamFetcher
not necessary
You should maybe have a look at the OptionsResolver Component of Symfony.
You could easily implements your own logic to "client" defining mandatory keys, default values, validations... and manage triggered errors to throw BadRequestException and return detailed errors.