{"action":"created","comment":{"url":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/comments/76320443","id":76320443,"diff_hunk":"@@ -465,3 +465,48 @@ def __call__(self, value):\n                 del choices[index]\n \n         return value\n+\n+\n+class Or(Validator):\n+    \"\"\"Validator which succeeds if ``value`` is validated by at least one of\n+    ``validator_list`` elements\n+\n+    :param validator_list:\n+    :param str error: Error message to raise in case of a validation error. Can be\n+        interpolated with `{input}`.\n+    \"\"\"\n+\n+    default_message = \"{input!r} can't be validated by any of the validators\"\n+\n+    def __init__(self, *validator_list, error=None, **kwargs):\n+        if any(not isinstance(validator, Validator) for validator in\n+                validator_list):","path":"marshmallow/validate.py","position":19,"original_position":19,"commit_id":"cde2ca2b84d61786a8b400115bea4e13823db2ea","original_commit_id":"cde2ca2b84d61786a8b400115bea4e13823db2ea","user":{"login":"justanr","id":4221605,"avatar_url":"https://avatars.githubusercontent.com/u/4221605?v=3","gravatar_id":"","url":"https://api.github.com/users/justanr","html_url":"https://github.com/justanr","followers_url":"https://api.github.com/users/justanr/followers","following_url":"https://api.github.com/users/justanr/following{/other_user}","gists_url":"https://api.github.com/users/justanr/gists{/gist_id}","starred_url":"https://api.github.com/users/justanr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justanr/subscriptions","organizations_url":"https://api.github.com/users/justanr/orgs","repos_url":"https://api.github.com/users/justanr/repos","events_url":"https://api.github.com/users/justanr/events{/privacy}","received_events_url":"https://api.github.com/users/justanr/received_events","type":"User","site_admin":false},"body":"Even better, allow it accept any callable that accepts the correct arguments.","created_at":"2016-08-25T20:41:12Z","updated_at":"2016-08-25T20:41:12Z","html_url":"https://github.com/marshmallow-code/marshmallow/pull/518#discussion_r76320443","pull_request_url":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/518","_links":{"self":{"href":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/comments/76320443"},"html":{"href":"https://github.com/marshmallow-code/marshmallow/pull/518#discussion_r76320443"},"pull_request":{"href":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/518"}}},"pull_request":{"url":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/518","id":82778227,"html_url":"https://github.com/marshmallow-code/marshmallow/pull/518","diff_url":"https://github.com/marshmallow-code/marshmallow/pull/518.diff","patch_url":"https://github.com/marshmallow-code/marshmallow/pull/518.patch","issue_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/518","number":518,"state":"open","locked":false,"title":"Add a new validat'Or","user":{"login":"Shir0kamii","id":4960324,"avatar_url":"https://avatars.githubusercontent.com/u/4960324?v=3","gravatar_id":"","url":"https://api.github.com/users/Shir0kamii","html_url":"https://github.com/Shir0kamii","followers_url":"https://api.github.com/users/Shir0kamii/followers","following_url":"https://api.github.com/users/Shir0kamii/following{/other_user}","gists_url":"https://api.github.com/users/Shir0kamii/gists{/gist_id}","starred_url":"https://api.github.com/users/Shir0kamii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shir0kamii/subscriptions","organizations_url":"https://api.github.com/users/Shir0kamii/orgs","repos_url":"https://api.github.com/users/Shir0kamii/repos","events_url":"https://api.github.com/users/Shir0kamii/events{/privacy}","received_events_url":"https://api.github.com/users/Shir0kamii/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nI've written a new validator, named `Or` as you can guess by the title. :)\r\n\r\nIt takes an undetermined number of validator as arguments, and it will try to validate the given value with each validator until one does it with success.\r\n\r\nI think it would be a good thing to merge it, since it allows to compose validator easily.\r\n\r\nI hope you'll like it!","created_at":"2016-08-25T19:26:33Z","updated_at":"2016-08-25T20:41:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"28db27e6305e941447cb15d796ab604157052ee0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/518/commits","review_comments_url":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/518/comments","review_comment_url":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/518/comments","statuses_url":"https://api.github.com/repos/marshmallow-code/marshmallow/statuses/cde2ca2b84d61786a8b400115bea4e13823db2ea","head":{"label":"Shir0kamii:feature/validate-or","ref":"feature/validate-or","sha":"cde2ca2b84d61786a8b400115bea4e13823db2ea","user":{"login":"Shir0kamii","id":4960324,"avatar_url":"https://avatars.githubusercontent.com/u/4960324?v=3","gravatar_id":"","url":"https://api.github.com/users/Shir0kamii","html_url":"https://github.com/Shir0kamii","followers_url":"https://api.github.com/users/Shir0kamii/followers","following_url":"https://api.github.com/users/Shir0kamii/following{/other_user}","gists_url":"https://api.github.com/users/Shir0kamii/gists{/gist_id}","starred_url":"https://api.github.com/users/Shir0kamii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shir0kamii/subscriptions","organizations_url":"https://api.github.com/users/Shir0kamii/orgs","repos_url":"https://api.github.com/users/Shir0kamii/repos","events_url":"https://api.github.com/users/Shir0kamii/events{/privacy}","received_events_url":"https://api.github.com/users/Shir0kamii/received_events","type":"User","site_admin":false},"repo":{"id":66550966,"name":"marshmallow","full_name":"Shir0kamii/marshmallow","owner":{"login":"Shir0kamii","id":4960324,"avatar_url":"https://avatars.githubusercontent.com/u/4960324?v=3","gravatar_id":"","url":"https://api.github.com/users/Shir0kamii","html_url":"https://github.com/Shir0kamii","followers_url":"https://api.github.com/users/Shir0kamii/followers","following_url":"https://api.github.com/users/Shir0kamii/following{/other_user}","gists_url":"https://api.github.com/users/Shir0kamii/gists{/gist_id}","starred_url":"https://api.github.com/users/Shir0kamii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shir0kamii/subscriptions","organizations_url":"https://api.github.com/users/Shir0kamii/orgs","repos_url":"https://api.github.com/users/Shir0kamii/repos","events_url":"https://api.github.com/users/Shir0kamii/events{/privacy}","received_events_url":"https://api.github.com/users/Shir0kamii/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Shir0kamii/marshmallow","description":"A lightweight library for converting complex objects to and from simple Python datatypes.","fork":true,"url":"https://api.github.com/repos/Shir0kamii/marshmallow","forks_url":"https://api.github.com/repos/Shir0kamii/marshmallow/forks","keys_url":"https://api.github.com/repos/Shir0kamii/marshmallow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shir0kamii/marshmallow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shir0kamii/marshmallow/teams","hooks_url":"https://api.github.com/repos/Shir0kamii/marshmallow/hooks","issue_events_url":"https://api.github.com/repos/Shir0kamii/marshmallow/issues/events{/number}","events_url":"https://api.github.com/repos/Shir0kamii/marshmallow/events","assignees_url":"https://api.github.com/repos/Shir0kamii/marshmallow/assignees{/user}","branches_url":"https://api.github.com/repos/Shir0kamii/marshmallow/branches{/branch}","tags_url":"https://api.github.com/repos/Shir0kamii/marshmallow/tags","blobs_url":"https://api.github.com/repos/Shir0kamii/marshmallow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shir0kamii/marshmallow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shir0kamii/marshmallow/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shir0kamii/marshmallow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shir0kamii/marshmallow/statuses/{sha}","languages_url":"https://api.github.com/repos/Shir0kamii/marshmallow/languages","stargazers_url":"https://api.github.com/repos/Shir0kamii/marshmallow/stargazers","contributors_url":"https://api.github.com/repos/Shir0kamii/marshmallow/contributors","subscribers_url":"https://api.github.com/repos/Shir0kamii/marshmallow/subscribers","subscription_url":"https://api.github.com/repos/Shir0kamii/marshmallow/subscription","commits_url":"https://api.github.com/repos/Shir0kamii/marshmallow/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shir0kamii/marshmallow/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shir0kamii/marshmallow/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shir0kamii/marshmallow/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shir0kamii/marshmallow/contents/{+path}","compare_url":"https://api.github.com/repos/Shir0kamii/marshmallow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shir0kamii/marshmallow/merges","archive_url":"https://api.github.com/repos/Shir0kamii/marshmallow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shir0kamii/marshmallow/downloads","issues_url":"https://api.github.com/repos/Shir0kamii/marshmallow/issues{/number}","pulls_url":"https://api.github.com/repos/Shir0kamii/marshmallow/pulls{/number}","milestones_url":"https://api.github.com/repos/Shir0kamii/marshmallow/milestones{/number}","notifications_url":"https://api.github.com/repos/Shir0kamii/marshmallow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shir0kamii/marshmallow/labels{/name}","releases_url":"https://api.github.com/repos/Shir0kamii/marshmallow/releases{/id}","deployments_url":"https://api.github.com/repos/Shir0kamii/marshmallow/deployments","created_at":"2016-08-25T11:07:47Z","updated_at":"2016-08-25T11:07:48Z","pushed_at":"2016-08-25T19:19:08Z","git_url":"git://github.com/Shir0kamii/marshmallow.git","ssh_url":"git@github.com:Shir0kamii/marshmallow.git","clone_url":"https://github.com/Shir0kamii/marshmallow.git","svn_url":"https://github.com/Shir0kamii/marshmallow","homepage":"http://marshmallow.readthedocs.io/","size":2350,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"marshmallow-code:dev","ref":"dev","sha":"62b683fe16b6fc3a2bd8e708267f8faa24227bc6","user":{"login":"marshmallow-code","id":10334301,"avatar_url":"https://avatars.githubusercontent.com/u/10334301?v=3","gravatar_id":"","url":"https://api.github.com/users/marshmallow-code","html_url":"https://github.com/marshmallow-code","followers_url":"https://api.github.com/users/marshmallow-code/followers","following_url":"https://api.github.com/users/marshmallow-code/following{/other_user}","gists_url":"https://api.github.com/users/marshmallow-code/gists{/gist_id}","starred_url":"https://api.github.com/users/marshmallow-code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marshmallow-code/subscriptions","organizations_url":"https://api.github.com/users/marshmallow-code/orgs","repos_url":"https://api.github.com/users/marshmallow-code/repos","events_url":"https://api.github.com/users/marshmallow-code/events{/privacy}","received_events_url":"https://api.github.com/users/marshmallow-code/received_events","type":"Organization","site_admin":false},"repo":{"id":14284859,"name":"marshmallow","full_name":"marshmallow-code/marshmallow","owner":{"login":"marshmallow-code","id":10334301,"avatar_url":"https://avatars.githubusercontent.com/u/10334301?v=3","gravatar_id":"","url":"https://api.github.com/users/marshmallow-code","html_url":"https://github.com/marshmallow-code","followers_url":"https://api.github.com/users/marshmallow-code/followers","following_url":"https://api.github.com/users/marshmallow-code/following{/other_user}","gists_url":"https://api.github.com/users/marshmallow-code/gists{/gist_id}","starred_url":"https://api.github.com/users/marshmallow-code/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marshmallow-code/subscriptions","organizations_url":"https://api.github.com/users/marshmallow-code/orgs","repos_url":"https://api.github.com/users/marshmallow-code/repos","events_url":"https://api.github.com/users/marshmallow-code/events{/privacy}","received_events_url":"https://api.github.com/users/marshmallow-code/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marshmallow-code/marshmallow","description":"A lightweight library for converting complex objects to and from simple Python datatypes.","fork":false,"url":"https://api.github.com/repos/marshmallow-code/marshmallow","forks_url":"https://api.github.com/repos/marshmallow-code/marshmallow/forks","keys_url":"https://api.github.com/repos/marshmallow-code/marshmallow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marshmallow-code/marshmallow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marshmallow-code/marshmallow/teams","hooks_url":"https://api.github.com/repos/marshmallow-code/marshmallow/hooks","issue_events_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/events{/number}","events_url":"https://api.github.com/repos/marshmallow-code/marshmallow/events","assignees_url":"https://api.github.com/repos/marshmallow-code/marshmallow/assignees{/user}","branches_url":"https://api.github.com/repos/marshmallow-code/marshmallow/branches{/branch}","tags_url":"https://api.github.com/repos/marshmallow-code/marshmallow/tags","blobs_url":"https://api.github.com/repos/marshmallow-code/marshmallow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marshmallow-code/marshmallow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marshmallow-code/marshmallow/git/refs{/sha}","trees_url":"https://api.github.com/repos/marshmallow-code/marshmallow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marshmallow-code/marshmallow/statuses/{sha}","languages_url":"https://api.github.com/repos/marshmallow-code/marshmallow/languages","stargazers_url":"https://api.github.com/repos/marshmallow-code/marshmallow/stargazers","contributors_url":"https://api.github.com/repos/marshmallow-code/marshmallow/contributors","subscribers_url":"https://api.github.com/repos/marshmallow-code/marshmallow/subscribers","subscription_url":"https://api.github.com/repos/marshmallow-code/marshmallow/subscription","commits_url":"https://api.github.com/repos/marshmallow-code/marshmallow/commits{/sha}","git_commits_url":"https://api.github.com/repos/marshmallow-code/marshmallow/git/commits{/sha}","comments_url":"https://api.github.com/repos/marshmallow-code/marshmallow/comments{/number}","issue_comment_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/comments{/number}","contents_url":"https://api.github.com/repos/marshmallow-code/marshmallow/contents/{+path}","compare_url":"https://api.github.com/repos/marshmallow-code/marshmallow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marshmallow-code/marshmallow/merges","archive_url":"https://api.github.com/repos/marshmallow-code/marshmallow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marshmallow-code/marshmallow/downloads","issues_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues{/number}","pulls_url":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls{/number}","milestones_url":"https://api.github.com/repos/marshmallow-code/marshmallow/milestones{/number}","notifications_url":"https://api.github.com/repos/marshmallow-code/marshmallow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marshmallow-code/marshmallow/labels{/name}","releases_url":"https://api.github.com/repos/marshmallow-code/marshmallow/releases{/id}","deployments_url":"https://api.github.com/repos/marshmallow-code/marshmallow/deployments","created_at":"2013-11-10T21:32:24Z","updated_at":"2016-08-25T20:02:05Z","pushed_at":"2016-08-25T19:26:33Z","git_url":"git://github.com/marshmallow-code/marshmallow.git","ssh_url":"git@github.com:marshmallow-code/marshmallow.git","clone_url":"https://github.com/marshmallow-code/marshmallow.git","svn_url":"https://github.com/marshmallow-code/marshmallow","homepage":"http://marshmallow.readthedocs.io/","size":2506,"stargazers_count":1253,"watchers_count":1253,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":149,"mirror_url":null,"open_issues_count":79,"forks":149,"open_issues":79,"watchers":1253,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/518"},"html":{"href":"https://github.com/marshmallow-code/marshmallow/pull/518"},"issue":{"href":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/518"},"comments":{"href":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/518/comments"},"review_comments":{"href":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/518/comments"},"review_comment":{"href":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marshmallow-code/marshmallow/pulls/518/commits"},"statuses":{"href":"https://api.github.com/repos/marshmallow-code/marshmallow/statuses/cde2ca2b84d61786a8b400115bea4e13823db2ea"}}}}
{"actor":{"display_login":"justanr"}}