{"action":"created","issue":{"url":"https://api.github.com/repos/contentful/contentful.java/issues/124","repository_url":"https://api.github.com/repos/contentful/contentful.java","labels_url":"https://api.github.com/repos/contentful/contentful.java/issues/124/labels{/name}","comments_url":"https://api.github.com/repos/contentful/contentful.java/issues/124/comments","events_url":"https://api.github.com/repos/contentful/contentful.java/issues/124/events","html_url":"https://github.com/contentful/contentful.java/issues/124","id":185932482,"number":124,"title":"CDAField's member validations is of wrong type.","user":{"login":"0x7f","id":176090,"avatar_url":"https://avatars.githubusercontent.com/u/176090?v=3","gravatar_id":"","url":"https://api.github.com/users/0x7f","html_url":"https://github.com/0x7f","followers_url":"https://api.github.com/users/0x7f/followers","following_url":"https://api.github.com/users/0x7f/following{/other_user}","gists_url":"https://api.github.com/users/0x7f/gists{/gist_id}","starred_url":"https://api.github.com/users/0x7f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0x7f/subscriptions","organizations_url":"https://api.github.com/users/0x7f/orgs","repos_url":"https://api.github.com/users/0x7f/repos","events_url":"https://api.github.com/users/0x7f/events{/privacy}","received_events_url":"https://api.github.com/users/0x7f/received_events","type":"User","site_admin":false},"labels":[{"id":116931315,"url":"https://api.github.com/repos/contentful/contentful.java/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":{"login":"mariobodemann","id":1162562,"avatar_url":"https://avatars.githubusercontent.com/u/1162562?v=3","gravatar_id":"","url":"https://api.github.com/users/mariobodemann","html_url":"https://github.com/mariobodemann","followers_url":"https://api.github.com/users/mariobodemann/followers","following_url":"https://api.github.com/users/mariobodemann/following{/other_user}","gists_url":"https://api.github.com/users/mariobodemann/gists{/gist_id}","starred_url":"https://api.github.com/users/mariobodemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariobodemann/subscriptions","organizations_url":"https://api.github.com/users/mariobodemann/orgs","repos_url":"https://api.github.com/users/mariobodemann/repos","events_url":"https://api.github.com/users/mariobodemann/events{/privacy}","received_events_url":"https://api.github.com/users/mariobodemann/received_events","type":"User","site_admin":false},"assignees":[{"login":"mariobodemann","id":1162562,"avatar_url":"https://avatars.githubusercontent.com/u/1162562?v=3","gravatar_id":"","url":"https://api.github.com/users/mariobodemann","html_url":"https://github.com/mariobodemann","followers_url":"https://api.github.com/users/mariobodemann/followers","following_url":"https://api.github.com/users/mariobodemann/following{/other_user}","gists_url":"https://api.github.com/users/mariobodemann/gists{/gist_id}","starred_url":"https://api.github.com/users/mariobodemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariobodemann/subscriptions","organizations_url":"https://api.github.com/users/mariobodemann/orgs","repos_url":"https://api.github.com/users/mariobodemann/repos","events_url":"https://api.github.com/users/mariobodemann/events{/privacy}","received_events_url":"https://api.github.com/users/mariobodemann/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-10-28T14:09:15Z","updated_at":"2017-01-03T10:11:37Z","closed_at":"2017-01-03T10:11:37Z","body":"Right now, the class `CDAField` has a member [`Map<String, Object> validations;`](https://github.com/contentful/contentful.java/blob/353a3897ffe570bcc7c7b53030449b5e18485895/src/main/java/com/contentful/java/cda/CDAField.java#L24).\n\nBut when having a look at the JSON preview of a content model in the web frontend, I see validations like these:\n\n```\n      \"validations\": [\n        {\n          \"in\": [\n            \"StringA\",\n            \"StringB\",\n            \"StringC\"\n          ]\n        }\n      ],\n```\n\nor\n\n```\n      \"validations\": [\n        {\n          \"linkContentType\": [\n            \"location\"\n          ]\n        }\n      ],\n```\n\nSo an array of maps of string to some object. When trying to deserialise them, i get the following exception:\n\n```\ncom.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT\n```\n\nUnfortunately, the [documentation](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/content-types/content-type) is not very clear about whether its a list or just the map. But at least [this example in the documentation](https://www.contentful.com/developers/docs/references/content-management-api/#/reference/editor-interface) is also using an array.\n\nThat's why I think the `validations` member is wrong and should be an array of maps. Or am I missing something here?\n"},"comment":{"url":"https://api.github.com/repos/contentful/contentful.java/issues/comments/270083385","html_url":"https://github.com/contentful/contentful.java/issues/124#issuecomment-270083385","issue_url":"https://api.github.com/repos/contentful/contentful.java/issues/124","id":270083385,"user":{"login":"mariobodemann","id":1162562,"avatar_url":"https://avatars.githubusercontent.com/u/1162562?v=3","gravatar_id":"","url":"https://api.github.com/users/mariobodemann","html_url":"https://github.com/mariobodemann","followers_url":"https://api.github.com/users/mariobodemann/followers","following_url":"https://api.github.com/users/mariobodemann/following{/other_user}","gists_url":"https://api.github.com/users/mariobodemann/gists{/gist_id}","starred_url":"https://api.github.com/users/mariobodemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariobodemann/subscriptions","organizations_url":"https://api.github.com/users/mariobodemann/orgs","repos_url":"https://api.github.com/users/mariobodemann/repos","events_url":"https://api.github.com/users/mariobodemann/events{/privacy}","received_events_url":"https://api.github.com/users/mariobodemann/received_events","type":"User","site_admin":false},"created_at":"2017-01-03T10:11:37Z","updated_at":"2017-01-03T10:11:37Z","body":"fixed by #127 \r\n\r\nThank you for reporting and fixing the issue!"}}
{"actor":{"display_login":"mariobodemann"}}