validate_schema.py 377 B

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