{"action":"opened","issue":{"url":"https://api.github.com/repos/pyeve/cerberus/issues/365","repository_url":"https://api.github.com/repos/pyeve/cerberus","labels_url":"https://api.github.com/repos/pyeve/cerberus/issues/365/labels{/name}","comments_url":"https://api.github.com/repos/pyeve/cerberus/issues/365/comments","events_url":"https://api.github.com/repos/pyeve/cerberus/issues/365/events","html_url":"https://github.com/pyeve/cerberus/issues/365","id":306848895,"number":365,"title":"Possible error in custom rule example code","user":{"login":"olegsv","id":4197479,"avatar_url":"https://avatars3.githubusercontent.com/u/4197479?v=4","gravatar_id":"","url":"https://api.github.com/users/olegsv","html_url":"https://github.com/olegsv","followers_url":"https://api.github.com/users/olegsv/followers","following_url":"https://api.github.com/users/olegsv/following{/other_user}","gists_url":"https://api.github.com/users/olegsv/gists{/gist_id}","starred_url":"https://api.github.com/users/olegsv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olegsv/subscriptions","organizations_url":"https://api.github.com/users/olegsv/orgs","repos_url":"https://api.github.com/users/olegsv/repos","events_url":"https://api.github.com/users/olegsv/events{/privacy}","received_events_url":"https://api.github.com/users/olegsv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-20T12:42:41Z","updated_at":"2018-03-20T12:42:41Z","closed_at":null,"author_association":"NONE","body":"I have copied an example code for class-based Validator from here : http://cerberus-sanhe.readthedocs.io/customize.html#class-validator\r\n\r\n```\r\nfrom cerberus import Validator\r\n\r\nclass MyValidator(Validator):\r\n    def _validate_isodd(self, isodd, field, value):\r\n        if isodd and not bool(value & 1):\r\n            self._error(field, \"Must be an odd number\")\r\n\r\n```\r\nUnfortunately the code emits user warning: (python3.5, cerberus 1.1)\r\n\r\n```\r\n/usr/local/lib/python3.5/dist-packages/cerberus/validator.py:1338: UserWarning: No validation schema is defined for the arguments of rule 'isodd'\r\n  \"'%s'\" % method_name.split('_', 2)[-1])\r\n\r\n```"}}
{"actor":{"display_login":"olegsv"}}