{"action":"created","issue":{"url":"https://api.github.com/repos/sloria/webargs/issues/111","repository_url":"https://api.github.com/repos/sloria/webargs","labels_url":"https://api.github.com/repos/sloria/webargs/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/sloria/webargs/issues/111/comments","events_url":"https://api.github.com/repos/sloria/webargs/issues/111/events","html_url":"https://github.com/sloria/webargs/issues/111","id":160582768,"number":111,"title":"Error message is unhelpful for List fields with OneOf requirements","user":{"login":"dswhite42","id":13909061,"avatar_url":"https://avatars.githubusercontent.com/u/13909061?v=3","gravatar_id":"","url":"https://api.github.com/users/dswhite42","html_url":"https://github.com/dswhite42","followers_url":"https://api.github.com/users/dswhite42/followers","following_url":"https://api.github.com/users/dswhite42/following{/other_user}","gists_url":"https://api.github.com/users/dswhite42/gists{/gist_id}","starred_url":"https://api.github.com/users/dswhite42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dswhite42/subscriptions","organizations_url":"https://api.github.com/users/dswhite42/orgs","repos_url":"https://api.github.com/users/dswhite42/repos","events_url":"https://api.github.com/users/dswhite42/events{/privacy}","received_events_url":"https://api.github.com/users/dswhite42/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-16T05:50:55Z","updated_at":"2016-06-22T02:53:14Z","closed_at":null,"body":"I want to accept multiple values for \"units\", but I want them to be limited to certain values (minutes, days, hours, years).  But given this:\r\n\r\n`args = {'units': fields.List(fields.Str(validate=validate.OneOf(['minutes', 'days', 'hours', 'years'])))}`\r\n\r\nand this URL:\r\n\r\n`http://localhost/test?units=days&units=hours&units=years&units=foobar`\r\n\r\nthe error message looks like this:\r\n\r\n    {\r\n        \"errors\": {\r\n            \"units\": {\r\n                \"3\": [\r\n                    \"Not a valid choice.\"\r\n                ]\r\n            }\r\n        },\r\n    }\r\n\r\nCan the error message show the wrong value (foobar) rather than show the index of the wrong entry (3)?\r\n"},"comment":{"url":"https://api.github.com/repos/sloria/webargs/issues/comments/227629627","html_url":"https://github.com/sloria/webargs/issues/111#issuecomment-227629627","issue_url":"https://api.github.com/repos/sloria/webargs/issues/111","id":227629627,"user":{"login":"dswhite42","id":13909061,"avatar_url":"https://avatars.githubusercontent.com/u/13909061?v=3","gravatar_id":"","url":"https://api.github.com/users/dswhite42","html_url":"https://github.com/dswhite42","followers_url":"https://api.github.com/users/dswhite42/followers","following_url":"https://api.github.com/users/dswhite42/following{/other_user}","gists_url":"https://api.github.com/users/dswhite42/gists{/gist_id}","starred_url":"https://api.github.com/users/dswhite42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dswhite42/subscriptions","organizations_url":"https://api.github.com/users/dswhite42/orgs","repos_url":"https://api.github.com/users/dswhite42/repos","events_url":"https://api.github.com/users/dswhite42/events{/privacy}","received_events_url":"https://api.github.com/users/dswhite42/received_events","type":"User","site_admin":false},"created_at":"2016-06-22T02:53:14Z","updated_at":"2016-06-22T02:53:14Z","body":"I think it does.  It would still be handy if the dict of error messages had the field name as the key rather than the list index.  (That way `http://localhost:5001/test?units=eons&units=eons&units=eons` would only produce a single error message with the key \"eons\" instead of three errors for index 0, 1, 2)  But that's minor.  I think your solution will be fine for what I need.  Thanks for the pointer."}}
{"actor":{"display_login":"dswhite42"}}