hyperion.ng/test/jsonchecks/checkschema.py
redPanther cab3c2fdc9 add more drawing func to effect engine (#400)
* - add more drawing func to effect engine
- make provider rs232 less noisy
- json checks: remove utf8 conversion temporarly and make it compat with py3 again

* fix compile prob
2017-02-16 07:33:58 +01:00

22 lines
532 B
Python

#!/usr/bin/env python
import json, sys, glob
from os import path
from jsonschema import Draft3Validator
print('-- validate json file')
jsonFileName = sys.argv[1]
schemaFileName = sys.argv[2]
try:
with open(schemaFileName) as schemaFile:
with open(jsonFileName) as jsonFile:
j = json.loads(jsonFile.read())
validator = Draft3Validator(json.loads(schemaFile.read()))
validator.validate(j)
except Exception as e:
print('validation error: '+jsonFileName + ' '+schemaFileName+' ('+str(e)+')')
sys.exit(1)
sys.exit(0)