version_json_validate_schema.py 391 B

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