{"action":"opened","issue":{"url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/588","repository_url":"https://api.github.com/repos/spring-projects/spring-restdocs","labels_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/588/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/588/comments","events_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/588/events","html_url":"https://github.com/spring-projects/spring-restdocs/issues/588","id":414771088,"node_id":"MDU6SXNzdWU0MTQ3NzEwODg=","number":588,"title":"Error when using requestFields","user":{"login":"kasperbisgaard","id":9379915,"node_id":"MDQ6VXNlcjkzNzk5MTU=","avatar_url":"https://avatars1.githubusercontent.com/u/9379915?v=4","gravatar_id":"","url":"https://api.github.com/users/kasperbisgaard","html_url":"https://github.com/kasperbisgaard","followers_url":"https://api.github.com/users/kasperbisgaard/followers","following_url":"https://api.github.com/users/kasperbisgaard/following{/other_user}","gists_url":"https://api.github.com/users/kasperbisgaard/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperbisgaard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperbisgaard/subscriptions","organizations_url":"https://api.github.com/users/kasperbisgaard/orgs","repos_url":"https://api.github.com/users/kasperbisgaard/repos","events_url":"https://api.github.com/users/kasperbisgaard/events{/privacy}","received_events_url":"https://api.github.com/users/kasperbisgaard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-02-26T19:09:41Z","updated_at":"2019-02-26T19:09:41Z","closed_at":null,"author_association":"NONE","body":"I am getting an error when i add requestFields to my documentation.\r\n`org.springframework.restdocs.snippet.SnippetException: Cannot document request fields as the request body is empty`\r\n\r\nThe request is NOT empty. The users is being created perfectly and the test passes if i remove the requestFields.\r\n\r\nThis is my test method:\r\n\r\n```\r\nMap<String, Object> userRequest = new HashMap<>();\r\nuserRequest.put(\"email\", \"test@testing.com\");\r\nuserRequest.put(\"password\", \"testpass\");\r\nuserRequest.put(\"passwordConfirmation\", \"testpass\");\r\nuserRequest.put(\"birthday\", new Date());\r\nuserRequest.put(\"countryCode\", \"DKN\");\r\nuserRequest.put(\"phoneNumber\", \"99999999\");\r\nuserRequest.put(\"about\", \"Testing\");\r\nuserRequest.put(\"gender\", \"MALE\");\r\nuserRequest.put(\"location\", \"Somewhere\");\r\nuserRequest.put(\"website\", \"www.testing.com\");\r\nuserRequest.put(\"firstName\", \"John\");\r\nuserRequest.put(\"lastName\", \"Doe\");\r\n\r\nmockMvc\r\n        .perform(post(\"/users\")\r\n                .contentType(MediaType.APPLICATION_JSON_VALUE)\r\n                .accept(MediaTypes.HAL_JSON_VALUE)\r\n                .content(objectMapper.writeValueAsString(userRequest)))\r\n        .andExpect(status().isCreated())\r\n        .andDo(document(\"users/create-user\",\r\n                requestFields(\r\n                        fieldWithPath(\"email\").description(\"User email address\"),\r\n                        fieldWithPath(\"password\").description(\"User password\"),\r\n                        fieldWithPath(\"passwordConfirmation\").description(\"User password confirmed\"),\r\n                        fieldWithPath(\"countryCode\").description(\"Country code 3 characters\"),\r\n                        fieldWithPath(\"phoneNumber\").description(\"Phone number\"),\r\n                        fieldWithPath(\"firstName\").description(\"First name\"),\r\n                        fieldWithPath(\"lastName\").description(\"Last name\"),\r\n                        fieldWithPath(\"location\").description(\"Geographical location\"),\r\n                        fieldWithPath(\"birthday\").description(\"Birthday - format: YYYY-MM-DD\"),\r\n                        fieldWithPath(\"about\").description(\"About text\"),\r\n                        fieldWithPath(\"gender\").description(\"Gender - MALE or FEMALE\"),\r\n                        fieldWithPath(\"website\").description(\"Website\")\r\n                ),\r\n                links(\r\n                        linkWithRel(\"self\").description(\"Self reference link\"),\r\n                        linkWithRel(\"profile\").description(\"Link to the users profile\")\r\n                ),responseFields(\r\n                        fieldWithPath(\"email\")\r\n                                .type(JsonFieldType.STRING)\r\n                                .description(\"User email\"),\r\n                        subsectionWithPath(\"_links\").ignored()\r\n                )\r\n        ));\r\n```"}}
{"actor":{"display_login":"kasperbisgaard"}}