Skip to content

Instantly share code, notes, and snippets.

@gsalgado
Created September 26, 2014 16:09
Show Gist options
  • Save gsalgado/f6682a48b73164acf149 to your computer and use it in GitHub Desktop.
Save gsalgado/f6682a48b73164acf149 to your computer and use it in GitHub Desktop.
import jsonschema
import json
l = [('../schema/seriesid-01.json', '../data/seriesid-01.json'), ...]
for schema_file, data_file in l:
schema = json.load(open(schema_file))
test_data = json.load(open(data_file))
result = jsonschema.validate(test_data,schema)
if result is not None:
print "Error validating %s against %s: %s" % (schema_file, data_file, result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment