This repository has been archived on 2020-12-30. You can view files and clone it, but cannot push or open issues or pull requests.
2016-09-18 16:30:45 +02:00
|
|
|
|
2016-09-16 19:25:02 +02:00
|
|
|
import sys
|
2016-09-18 16:30:45 +02:00
|
|
|
from jsonschema import validate
|
|
|
|
import yaml
|
|
|
|
|
2016-09-16 19:25:02 +02:00
|
|
|
|
|
|
|
|
2016-09-18 16:30:45 +02:00
|
|
|
def main(argv):
|
|
|
|
schemafile = "schema.yml"
|
2016-09-16 19:25:02 +02:00
|
|
|
schema = None
|
2016-09-18 16:30:45 +02:00
|
|
|
schemadata = None
|
2016-09-16 19:25:02 +02:00
|
|
|
with open(schemafile, "r") as f:
|
2016-09-18 16:30:45 +02:00
|
|
|
schemadata = yaml.load(f)
|
|
|
|
data = None
|
|
|
|
with open(argv[1], "r") as f:
|
|
|
|
data = yaml.load(f)
|
2016-09-16 19:25:02 +02:00
|
|
|
# get all yml files from protocols
|
|
|
|
# validate with
|
2016-09-18 16:30:45 +02:00
|
|
|
validate(data, schemadata)
|
|
|
|
|
2016-09-16 19:25:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2016-09-18 16:30:45 +02:00
|
|
|
main(sys.argv)
|