diff --git a/scripts/test-schema.py b/scripts/test-schema.py new file mode 100644 index 0000000..8df8617 --- /dev/null +++ b/scripts/test-schema.py @@ -0,0 +1,17 @@ +import sys + +import simplejson +import jsonschema + +schema_filename = sys.argv[1] +message_filename = sys.argv[2] + +schema_file = open(schema_filename, 'r') +schema_data = schema_file.read() +schema = simplejson.loads(schema_data) + +message_file = open(message_filename, 'r') +message_data = message_file.read() +message = simplejson.loads(message_data) + +jsonschema.validate(message, schema, format_checker=jsonschema.FormatChecker())