Skip to content

Instantly share code, notes, and snippets.

@dagwieers
Created September 21, 2018 13:23
Show Gist options
  • Save dagwieers/96708bc3d5d04fbcd6c25e9bfee4da53 to your computer and use it in GitHub Desktop.
Save dagwieers/96708bc3d5d04fbcd6c25e9bfee4da53 to your computer and use it in GitHub Desktop.
seealso schema validation
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