{"action":"closed","issue":{"url":"https://api.github.com/repos/nicolaiarocci/cerberus/issues/175","labels_url":"https://api.github.com/repos/nicolaiarocci/cerberus/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/nicolaiarocci/cerberus/issues/175/comments","events_url":"https://api.github.com/repos/nicolaiarocci/cerberus/issues/175/events","html_url":"https://github.com/nicolaiarocci/cerberus/issues/175","id":118483932,"number":175,"title":"required and dependencies","user":{"login":"jmesquita","id":273966,"avatar_url":"https://avatars.githubusercontent.com/u/273966?v=3","gravatar_id":"","url":"https://api.github.com/users/jmesquita","html_url":"https://github.com/jmesquita","followers_url":"https://api.github.com/users/jmesquita/followers","following_url":"https://api.github.com/users/jmesquita/following{/other_user}","gists_url":"https://api.github.com/users/jmesquita/gists{/gist_id}","starred_url":"https://api.github.com/users/jmesquita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmesquita/subscriptions","organizations_url":"https://api.github.com/users/jmesquita/orgs","repos_url":"https://api.github.com/users/jmesquita/repos","events_url":"https://api.github.com/users/jmesquita/events{/privacy}","received_events_url":"https://api.github.com/users/jmesquita/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-23T22:07:44Z","updated_at":"2015-12-09T15:58:12Z","closed_at":"2015-12-09T15:58:12Z","body":"Hello again, I am actively using Cerberus again and I am intrigued towards why this test case does not work:\r\n\r\n```python\r\nfrom cerberus import Validator\r\n\r\nextension_schema = {\r\n    'name': {'type': 'string', 'required': True},\r\n    'type': {'type': 'string', 'required': True, 'allowed': ['khomp_fxs', 'sofia_user']},\r\n    'note' : {'type': 'string', 'required': False, 'nullable': True},\r\n    'caller_id_name': {'type': 'string', 'nullable': False, 'required': True},\r\n    'caller_id_number': {'type': 'integer', 'nullable': False, 'required': True},\r\n    'fax_enabled': {'type': 'boolean', 'required': False},\r\n    'cos': {'type': 'list', 'required': True, 'schema': {'type': 'integer'} },\r\n    ## SIP\r\n    'password': {'type': 'string', 'required': True, 'dependencies': {'type': ['sofia_user']}},\r\n    ## FXS\r\n    'channel': {'type': 'dict', 'required': False, 'dependencies': {'type': 'khomp_fxs'} , 'schema': {\r\n        'id': {'type': 'integer', 'required': True}\r\n    } },\r\n    'fax_detection_timeout': {'type': 'integer', 'required': True, 'dependencies': {'type': 'khomp_fxs'}, 'nullable':True },\r\n    'bina': {'type': 'boolean', 'required': False, 'dependencies': {'type': ['khomp_fxs']}, 'nullable': True },\r\n    ## Groups\r\n    'groups': {\r\n        'type': 'dict', 'required': False, 'schema': {\r\n            'pickupgroup': {\r\n                'type': 'dict', 'schema': {\r\n                    'id': {'type': 'integer', 'required': True}\r\n                }\r\n            }\r\n        }\r\n    },\r\n    ## Voicemail stuff\r\n    'voicemail': {\r\n        'type': 'dict', 'required': True, 'schema': {\r\n            'enabled': {'type': 'boolean', 'required': True},\r\n            'password': {'type': 'string', 'required': True, 'dependencies': {'voicemail.enabled': True} },\r\n            'email': {'type': 'string', 'required': True, 'dependencies': {'voicemail.enabled': True, 'notify': True} },\r\n            'notify': {'type': 'boolean', 'required': False, 'dependencies': {'voicemail.enabled': True} },\r\n            'attach': {'type': 'boolean', 'required': False, 'dependencies': {'voicemail.enabled': True, 'notify': True} },\r\n            'delete': {'type': 'boolean', 'required': False, 'dependencies': {'voicemail.enabled': True, 'notify': True, 'attach': True} }\r\n        }\r\n    },\r\n    ## Padlock\r\n    'padlock': {\r\n        'type': 'dict', 'required': True, 'schema': {\r\n            'enabled': {'type': 'boolean', 'required': True},\r\n            'pin': {'type': 'string', 'required': True, 'dependencies': {'padlock.enabled': True} },\r\n            'cos': {'type': 'list', 'required': True, 'schema': {'type': 'integer'}, 'dependencies': {'padlock.enabled': True} }\r\n        }\r\n    }\r\n\r\n}\r\n\r\ndata = {\r\n    \"voicemail\":{\"enabled\":False},\r\n    \"padlock\":{\"enabled\":False},\r\n    \"type\":\"sofia_user\",\r\n    \"name\":\"test2\",\r\n    \"password\":\"96NoWg8xR4y\",\r\n    \"caller_id_name\":\"123\",\r\n    \"caller_id_number\":123,\r\n    \"cos\":[1]\r\n}\r\n\r\n\r\nv = Validator(extension_schema, allow_unknown=True)\r\nif not v.validate(data):\r\n    print(v.errors)\r\n```\r\n\r\nThe output I get is:\r\n```{'padlock': {'cos': 'required field', 'pin': 'required field'}, 'voicemail': {'password': 'required field', 'email': 'required field'}, 'fax_detection_timeout': 'required field'}```\r\n\r\nAm I not reading correctly? I thought dependencies as a dict meant that a certain field is required only if the dependency (along with it's value) are matched and that this rule applied to sub-documents as well. What am I doing wrong? I am using the 0.9.1 from pip, btw."}}