diff --git a/Project.toml b/Project.toml index 8b58c3af20..1f79256b4f 100644 --- a/Project.toml +++ b/Project.toml @@ -20,7 +20,7 @@ BenchmarkTools = "0.4, 0.5" CodecBzip2 = "~0.6, 0.7" CodecZlib = "~0.6, 0.7" JSON = "~0.21" -JSONSchema = "0.2" +JSONSchema = "0.3" MutableArithmetics = "0.2" OrderedCollections = "1" julia = "1" diff --git a/src/FileFormats/MOF/MOF.jl b/src/FileFormats/MOF/MOF.jl index 02f6325d60..63028c1d7e 100644 --- a/src/FileFormats/MOF/MOF.jl +++ b/src/FileFormats/MOF/MOF.jl @@ -105,9 +105,12 @@ function validate(io::IO) object = JSON.parse(io) seekstart(io) mof_schema = JSONSchema.Schema(JSON.parsefile(SCHEMA_PATH, use_mmap=false)) - if !JSONSchema.isvalid(object, mof_schema) - error("Unable to read file because it does not conform to the MOF " * - "schema: ", JSONSchema.diagnose(object, mof_schema)) + ret = JSONSchema.validate(object, mof_schema) + if ret !== nothing + error( + "Unable to read file because it does not conform to the MOF " * + "schema: ", ret + ) end return end