validate_schema.py 403 B

1234567891011121314151617
  1. import jsmin
  2. import json
  3. import jsonschema
  4. import os.path
  5. import sys
  6. with open(sys.argv[1], "rb") as f:
  7. contents = json.loads(jsmin.jsmin(f.read().decode("utf-8-sig")))
  8. schema_file = os.path.join(
  9. os.path.dirname(__file__),
  10. "..", "..", "..", "Help", "manual", "presets", "schema.json")
  11. with open(schema_file) as f:
  12. schema = json.load(f)
  13. jsonschema.validate(contents, schema)