@@ -0,0 +1,1672 @@
+#! /usr/bin/env python%0A%0Aimport sys%0Aimport json%0Aimport os%0A%0A%0Adef import_error(module, package, debian, error):%0A    sys.stderr.write((%0A        %22Error importing %25(module)s: %25(error)r%5Cn%22%0A        %22To install %25(module)s run:%5Cn%22%0A        %22  pip install %25(package)s%5Cn%22%0A        %22or on Debian run:%5Cn%22%0A        %22  sudo apt-get install python-%25(debian)s%5Cn%22%0A    ) %25 locals())%0A    if __name__ == '__main__':%0A        sys.exit(1)%0A%0Atry:%0A    import jsonschema%0Aexcept ImportError as e:%0A    import_error(%22jsonschema%22, %22jsonschema%22, %22jsonschema%22, e)%0A    raise%0A%0Atry:%0A    import yaml%0Aexcept ImportError as e:%0A    import_error(%22yaml%22, %22PyYAML%22, %22yaml%22, e)%0A    raise%0A%0A%0Adef check_example_file(examplepath, schemapath):%0A    with open(examplepath) as f:%0A        example = yaml.load(f)%0A%0A    with open(schemapath) as f:%0A        schema = yaml.load(f)%0A%0A    fileurl = %22file://%22 + os.path.abspath(schemapath)%0A%0A    print (%22Checking schema for: %25r %25r%22 %25 (examplepath, schemapath))%0A    # Setting the 'id' tells jsonschema where the file is so that it%0A    # can correctly resolve relative $ref references in the schema%0A    schema%5B'id'%5D = fileurl%0A    try:%0A        jsonschema.validate(example, schema)%0A    except:%0A        raise ValueError(%22Error validating JSON schema for %25r %25r%22 %25 (%0A            examplepath, schemapath%0A        ), e)%0A%0A%0Adef check_example_dir(exampledir, schemadir):%0A    for root, dirs, files in os.walk(exampledir):%0A        for filename in files:%0A            examplepath = os.path.join(root, filename)%0A            schemapath = examplepath.replace(exampledir, schemadir)%0A            check_example_file(examplepath, schemapath)%0A%0A%0Aif __name__ == '__main__':%0A    check_example_dir(%22examples%22, %22schema%22)%0A

Add a python script for checking that the examples match the event schema.