cmake/Tests/RunCMake/CMakePresets/validate_schema.py
2021-09-14 00:13:48 +02:00

17 lines
377 B
Python

import json
import jsonschema
import os.path
import sys
with open(sys.argv[1], "rb") as f:
contents = json.loads(f.read().decode("utf-8-sig"))
schema_file = os.path.join(
os.path.dirname(__file__),
"..", "..", "..", "Help", "manual", "presets", "schema.json")
with open(schema_file) as f:
schema = json.load(f)
jsonschema.validate(contents, schema)