Last active
August 29, 2015 14:24
-
-
Save jharmn/923fb14a948b34c65ee8 to your computer and use it in GitHub Desktop.
Validate JSON against JSON Schema using Python jsonschema
This file contains hidden or 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 jsonschema import validate | |
from json import load | |
instance = load(open('data.json', 'r+')) | |
schema = load(open('schema.json', 'r+')) | |
print(validate(instance, schema)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Write
data.json
to disk, thenschema.json
, andpython validate.py