Skip to content

Instantly share code, notes, and snippets.

@jharmn
Last active August 29, 2015 14:24
Show Gist options
  • Save jharmn/923fb14a948b34c65ee8 to your computer and use it in GitHub Desktop.
Save jharmn/923fb14a948b34c65ee8 to your computer and use it in GitHub Desktop.
Validate JSON against JSON Schema using Python jsonschema
from jsonschema import validate
from json import load
instance = load(open('data.json', 'r+'))
schema = load(open('schema.json', 'r+'))
print(validate(instance, schema))
@jharmn
Copy link
Author

jharmn commented Jul 14, 2015

Write data.json to disk, then schema.json, and python validate.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment