Skip to content

Instantly share code, notes, and snippets.

@oxtopus
Last active December 23, 2015 22:09
Show Gist options
  • Save oxtopus/6701439 to your computer and use it in GitHub Desktop.
Save oxtopus/6701439 to your computer and use it in GitHub Desktop.
import validictory
import yaml
data = yaml.load("""
- foo
- bar: [baz, null, 1.0, 2]
""")
with open('schema.yml', 'r') as inp:
schema = yaml.load(inp.read())
validictory.validate(data,schema)
items:
- type: string
- properties:
bar:
items:
- type: string
- type: any
- type: number
- type: integer
type: object
type: array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment