48 if len(sys.argv) != 3:
49 print(f
"usage: {sys.argv[0]} <instance.json> <schema.json>", file=sys.stderr)
57 with open(instance_path, encoding=
"utf-8")
as f:
58 instance = json.load(f)
59 with open(schema_path, encoding=
"utf-8")
as f:
62 validator_cls = jsonschema.validators.validator_for(schema)
63 validator_cls.check_schema(schema)
64 validator = validator_cls(schema)
66 errors = sorted(validator.iter_errors(instance), key=str)
68 print(error, file=sys.stderr)
70 return 1
if errors
else 0