{"action":"closed","issue":{"url":"https://api.github.com/repos/tidwall/gjson/issues/10","repository_url":"https://api.github.com/repos/tidwall/gjson","labels_url":"https://api.github.com/repos/tidwall/gjson/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/tidwall/gjson/issues/10/comments","events_url":"https://api.github.com/repos/tidwall/gjson/issues/10/events","html_url":"https://github.com/tidwall/gjson/issues/10","id":186870945,"number":10,"title":"Behavior of Array() on non-array field","user":{"login":"wI2L","id":6519569,"avatar_url":"https://avatars.githubusercontent.com/u/6519569?v=3","gravatar_id":"","url":"https://api.github.com/users/wI2L","html_url":"https://github.com/wI2L","followers_url":"https://api.github.com/users/wI2L/followers","following_url":"https://api.github.com/users/wI2L/following{/other_user}","gists_url":"https://api.github.com/users/wI2L/gists{/gist_id}","starred_url":"https://api.github.com/users/wI2L/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wI2L/subscriptions","organizations_url":"https://api.github.com/users/wI2L/orgs","repos_url":"https://api.github.com/users/wI2L/repos","events_url":"https://api.github.com/users/wI2L/events{/privacy}","received_events_url":"https://api.github.com/users/wI2L/received_events","type":"User","site_admin":false},"labels":[{"id":422956623,"url":"https://api.github.com/repos/tidwall/gjson/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-02T17:41:03Z","updated_at":"2016-11-02T19:47:17Z","closed_at":"2016-11-02T19:47:17Z","body":"Hi\r\n\r\nI have a particular case where a field can be either an array of strings, or a string.\r\nNaively I tried to use `Array()` on the result when the field is a simple string to see if it would return an array with a single element, but instead the returned array is empty.\r\n\r\nSo I tried another solution, using the `myfield.#` notation on a non-array field, and I expected it to be zero, but instead i get `null`.\r\n\r\nDo you know how I should address this use-case ? Would it be possible to return an array with a single element when using `Array()` on a non-array field ?\r\n\r\nWilliam"}}
{"actor":{"display_login":"tidwall"}}