{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/516","repository_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2","labels_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/516/labels{/name}","comments_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/516/comments","events_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/516/events","html_url":"https://github.com/algolia/algoliasearch-client-java-2/issues/516","id":373411091,"node_id":"MDU6SXNzdWUzNzM0MTEwOTE=","number":516,"title":"Add: JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY as default","user":{"login":"Ant-hem","id":22633119,"node_id":"MDQ6VXNlcjIyNjMzMTE5","avatar_url":"https://avatars3.githubusercontent.com/u/22633119?v=4","gravatar_id":"","url":"https://api.github.com/users/Ant-hem","html_url":"https://github.com/Ant-hem","followers_url":"https://api.github.com/users/Ant-hem/followers","following_url":"https://api.github.com/users/Ant-hem/following{/other_user}","gists_url":"https://api.github.com/users/Ant-hem/gists{/gist_id}","starred_url":"https://api.github.com/users/Ant-hem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ant-hem/subscriptions","organizations_url":"https://api.github.com/users/Ant-hem/orgs","repos_url":"https://api.github.com/users/Ant-hem/repos","events_url":"https://api.github.com/users/Ant-hem/events{/privacy}","received_events_url":"https://api.github.com/users/Ant-hem/received_events","type":"User","site_admin":false},"labels":[{"id":856494655,"node_id":"MDU6TGFiZWw4NTY0OTQ2NTU=","url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/labels/Bug","name":"Bug","color":"ff4f81","default":false}],"state":"open","locked":false,"assignee":{"login":"Ant-hem","id":22633119,"node_id":"MDQ6VXNlcjIyNjMzMTE5","avatar_url":"https://avatars3.githubusercontent.com/u/22633119?v=4","gravatar_id":"","url":"https://api.github.com/users/Ant-hem","html_url":"https://github.com/Ant-hem","followers_url":"https://api.github.com/users/Ant-hem/followers","following_url":"https://api.github.com/users/Ant-hem/following{/other_user}","gists_url":"https://api.github.com/users/Ant-hem/gists{/gist_id}","starred_url":"https://api.github.com/users/Ant-hem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ant-hem/subscriptions","organizations_url":"https://api.github.com/users/Ant-hem/orgs","repos_url":"https://api.github.com/users/Ant-hem/repos","events_url":"https://api.github.com/users/Ant-hem/events{/privacy}","received_events_url":"https://api.github.com/users/Ant-hem/received_events","type":"User","site_admin":false},"assignees":[{"login":"Ant-hem","id":22633119,"node_id":"MDQ6VXNlcjIyNjMzMTE5","avatar_url":"https://avatars3.githubusercontent.com/u/22633119?v=4","gravatar_id":"","url":"https://api.github.com/users/Ant-hem","html_url":"https://github.com/Ant-hem","followers_url":"https://api.github.com/users/Ant-hem/followers","following_url":"https://api.github.com/users/Ant-hem/following{/other_user}","gists_url":"https://api.github.com/users/Ant-hem/gists{/gist_id}","starred_url":"https://api.github.com/users/Ant-hem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ant-hem/subscriptions","organizations_url":"https://api.github.com/users/Ant-hem/orgs","repos_url":"https://api.github.com/users/Ant-hem/repos","events_url":"https://api.github.com/users/Ant-hem/events{/privacy}","received_events_url":"https://api.github.com/users/Ant-hem/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-10-24T10:22:58Z","updated_at":"2018-10-24T10:40:24Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"- Algolia Client Version: 2.2.0\r\n\r\n### Description\r\nThis is an issue, I discovered from a support ticket.\r\nThe Java client can't manage to deserialize `List<String>` or `String[]` when it has only one element.\r\n\r\n### Steps To Reproduce\r\nYou have a Java class with a property which is a list/array of strings. \r\nYou index the Object with a List of only one element to the seach engine.\r\nTry to search the index you'll get this error\r\n\r\n`MismatchedInputException: Cannot deserialize instance of java.util.ArrayList out of VALUE_STRING` \r\n\r\n### Solution\r\nAdd `mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true)`\r\nto our default mapper's configuration.\r\n\r\ncc: @aseure @ElPicador \r\n"},"comment":{"url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/comments/432605942","html_url":"https://github.com/algolia/algoliasearch-client-java-2/issues/516#issuecomment-432605942","issue_url":"https://api.github.com/repos/algolia/algoliasearch-client-java-2/issues/516","id":432605942,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjYwNTk0Mg==","user":{"login":"Ant-hem","id":22633119,"node_id":"MDQ6VXNlcjIyNjMzMTE5","avatar_url":"https://avatars3.githubusercontent.com/u/22633119?v=4","gravatar_id":"","url":"https://api.github.com/users/Ant-hem","html_url":"https://github.com/Ant-hem","followers_url":"https://api.github.com/users/Ant-hem/followers","following_url":"https://api.github.com/users/Ant-hem/following{/other_user}","gists_url":"https://api.github.com/users/Ant-hem/gists{/gist_id}","starred_url":"https://api.github.com/users/Ant-hem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ant-hem/subscriptions","organizations_url":"https://api.github.com/users/Ant-hem/orgs","repos_url":"https://api.github.com/users/Ant-hem/repos","events_url":"https://api.github.com/users/Ant-hem/events{/privacy}","received_events_url":"https://api.github.com/users/Ant-hem/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T10:40:24Z","updated_at":"2018-10-24T10:40:24Z","author_association":"CONTRIBUTOR","body":"You think it's a bad idea to do the fix?\r\n\r\nIf it's not a default setting, it means the Java client can't handle the deserialisation  of`String[]` or `List<String>` which has only one element.\r\n\r\n Our customers has to add the following annotation to all theirs`String[]` `List<String>` \r\n`@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)`"}}
{"actor":{"display_login":"Ant-hem"}}