Created
September 21, 2018 13:23
-
-
Save dagwieers/96708bc3d5d04fbcd6c25e9bfee4da53 to your computer and use it in GitHub Desktop.
seealso schema validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from voluptuous import Schema, Any, Required | |
schema = Schema([ | |
Any( | |
{ | |
Required('module'): str, | |
'description': str, | |
}, | |
{ | |
Required('ref'): str, | |
Required('description'): str, | |
}, | |
{ | |
Required('name'): str, | |
Required('link'): str, | |
Required('description'): str, | |
}, | |
), | |
]) | |
schema([ | |
{ | |
'module': 'aci_subet', | |
} | |
]) | |
schema([ | |
{ | |
'module': 'aci_subet', | |
}, | |
{ | |
'module': 'aci_subet', | |
'description': 'Foo bar', | |
}, | |
{ | |
'ref': 'aci_guide', | |
'description': 'Foo bar', | |
}, | |
]) | |
schema([{ | |
'foo': 'aci_subet', | |
}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment