def validate_config(fname):
"""
Validate configuration file in json format.
"""
# Load schema
schema_fname = pkg_resources.resource_filename('export2hdf5', "config_schema.json")
schema = load_json_file(schema_fname)
config = load_json_file(fname)
res = None
try:
jsonschema.validate(config, schema)
except jsonschema.ValidationError as e:
res = e.message
except jsonschema.SchemaError as e:
res = e
return res
评论列表
文章目录