This is my configuration file:
// app/config/config.yml
fos_rest:
body_listener:
array_normalizer: fos_rest.normalizer.camel_keys
I am using the latest version of FOSRestBundle:
"friendsofsymfony/rest-bundle": "dev-master"
These are my message options:
"first_name": "First name",
"last_name": "Last name",
"phone": "Phone"
This is my controller:
public function postAction(Request $request)
{
$user = new User();
$form = $this->createForm(new UserType(), $user);
$form->handleRequest($request);
if ($form->isValid()) {
return 'valid';
}
return $user;
}
Problem:
The parameters of the request are not related to the camel. I get first_name, last_name, phone instead of firstName, lastName, phone. I did the same as https://florian.voutzinos.com/blog/handling-camelcase-with-fosrestbundle/ . But that did not work. Am I missing something? Any ideas? Thank.
source
share