{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/96","labels_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/96/comments","events_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/96/events","html_url":"https://github.com/spring-projects/spring-restdocs/issues/96","id":96570122,"number":96,"title":"How to document JSON array field","user":{"login":"rozhok","id":1721631,"avatar_url":"https://avatars.githubusercontent.com/u/1721631?v=3","gravatar_id":"","url":"https://api.github.com/users/rozhok","html_url":"https://github.com/rozhok","followers_url":"https://api.github.com/users/rozhok/followers","following_url":"https://api.github.com/users/rozhok/following{/other_user}","gists_url":"https://api.github.com/users/rozhok/gists{/gist_id}","starred_url":"https://api.github.com/users/rozhok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rozhok/subscriptions","organizations_url":"https://api.github.com/users/rozhok/orgs","repos_url":"https://api.github.com/users/rozhok/repos","events_url":"https://api.github.com/users/rozhok/events{/privacy}","received_events_url":"https://api.github.com/users/rozhok/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-22T13:37:32Z","updated_at":"2015-07-22T14:58:55Z","closed_at":"2015-07-22T14:06:42Z","body":"Hello guys, I'm wondering how to document following response:\r\n```\r\n[ \"Red\", \"Green\", \"Blue\" ]\r\n```\r\nI want to document unnamed array and failing with following constructions:\r\n```\r\n.withResponseFields(\r\n        fieldWithPath(\"*\").description(\"List of colors\")));\r\n```\r\nor\r\n```\r\n.withResponseFields(\r\n        fieldWithPath(\"$[]\").description(\"List of colors\")));\r\n```\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/comments/123749957","html_url":"https://github.com/spring-projects/spring-restdocs/issues/96#issuecomment-123749957","issue_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/96","id":123749957,"user":{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T14:58:55Z","updated_at":"2015-07-22T14:58:55Z","body":"If the array is empty you'll have to mark the field as optional and explicitly provide a type for its contents. For example:\r\n\r\n```java\r\n.withResponseFields(\r\n        fieldWithPath(\"[]\").description(\"List of colors\").optional().type(FieldType.STRING));\r\n```"}}