{"action":"created","issue":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/912","labels_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/912/labels{/name}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/912/comments","events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/912/events","html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/issues/912","id":50373832,"number":912,"title":"Post JSON DATA from FormType","user":{"login":"L0rD59","id":3115143,"avatar_url":"https://avatars.githubusercontent.com/u/3115143?v=3","gravatar_id":"","url":"https://api.github.com/users/L0rD59","html_url":"https://github.com/L0rD59","followers_url":"https://api.github.com/users/L0rD59/followers","following_url":"https://api.github.com/users/L0rD59/following{/other_user}","gists_url":"https://api.github.com/users/L0rD59/gists{/gist_id}","starred_url":"https://api.github.com/users/L0rD59/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/L0rD59/subscriptions","organizations_url":"https://api.github.com/users/L0rD59/orgs","repos_url":"https://api.github.com/users/L0rD59/repos","events_url":"https://api.github.com/users/L0rD59/events{/privacy}","received_events_url":"https://api.github.com/users/L0rD59/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-11-28T13:23:13Z","updated_at":"2015-05-04T13:08:23Z","closed_at":null,"body":"Hi all\r\n\r\nI've some trouble with FosRestBundle\r\n\r\nI wanna post a json content to my create entity route from a serialization of my formtype\r\n\r\ni have a methods like bellow : \r\n\r\n```php\r\n/**\r\n     * Presents the form to use to create a new address.\r\n     *\r\n     * @NelmioApiDocBundle\\Annotation\\ApiDoc(\r\n     *   section=\"Address\",\r\n     *   resource=true,\r\n     *   description=\"Presents the form to use to create a new address.\",\r\n     *   statusCodes = {\r\n     *     200 = \"Returned when successful\"\r\n     *   },\r\n     * )\r\n     *\r\n     * @FOSRestBundle\\Controller\\Annotations\\View()\r\n     *\r\n     * @return Form\\FormTypeInterface\r\n     */\r\n    public function newAddressAction()\r\n    {\r\n        return $this->getForm();\r\n    }\r\n\r\n    protected function getForm(LIGAppBundle\\Entity\\EnacoAddress $address = null, $options = array())\r\n    {\r\n        return $this->createForm($this->get('lig_app.form.address_type'), $address, $options);\r\n    }\r\n```\r\n\r\nreturn me : \r\n\r\n```javascript\r\n{\"children\":{\"customer\":[],\"address1\":[],\"address2\":[],\"postcode\":[],\"city\":[],\"phone\":[],\"phoneMobile\":[],\"idCountry\":[]}} \r\n```\r\n\r\nI've 2 pbs with this return :\r\n\r\nfirst : i dont want children index\r\n\r\nsecond : my default value is an array.\r\n\r\nI would be a return like this to post it directly : \r\n\r\n```javascript\r\n{\"customer\":\"\",\"address1\":\"\",\"address2\":\"\",\"postcode\":\"\",\"city\":\"\",\"phone\":\"\",\"phoneMobile\":\"\",\"idCountry\":\"\"}\r\n```\r\n(Or with default value)\r\n\r\nI dont know how to achieve that\r\n\r\nThx for replies"},"comment":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/comments/98700849","html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/issues/912#issuecomment-98700849","issue_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/912","id":98700849,"user":{"login":"Nicorr","id":5920204,"avatar_url":"https://avatars.githubusercontent.com/u/5920204?v=3","gravatar_id":"","url":"https://api.github.com/users/Nicorr","html_url":"https://github.com/Nicorr","followers_url":"https://api.github.com/users/Nicorr/followers","following_url":"https://api.github.com/users/Nicorr/following{/other_user}","gists_url":"https://api.github.com/users/Nicorr/gists{/gist_id}","starred_url":"https://api.github.com/users/Nicorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nicorr/subscriptions","organizations_url":"https://api.github.com/users/Nicorr/orgs","repos_url":"https://api.github.com/users/Nicorr/repos","events_url":"https://api.github.com/users/Nicorr/events{/privacy}","received_events_url":"https://api.github.com/users/Nicorr/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T13:08:23Z","updated_at":"2015-05-04T13:08:23Z","body":"Hey, I had a similar problem, turns out the JSON Payload was malformed (i had to deleyer the name of the first node).\r\n\r\nDetails here : http://stackoverflow.com/questions/29984372/symfony-fosrestbundle-post-request-500-error/30030712#30030712\r\n\r\nHope it helps"}}