diff --git a/src/command_metaschema.cc b/src/command_metaschema.cc index 9c19f431..fb6c53f3 100644 --- a/src/command_metaschema.cc +++ b/src/command_metaschema.cc @@ -44,7 +44,7 @@ auto sourcemeta::jsonschema::cli::metaschema( cache.insert({dialect.value(), metaschema_template}); } - sourcemeta::blaze::ErrorTraceOutput output{metaschema}; + sourcemeta::blaze::ErrorTraceOutput output{entry.second}; if (sourcemeta::blaze::evaluate(cache.at(dialect.value()), entry.second, std::ref(output))) { log_verbose(options) diff --git a/test/metaschema/fail_directory.sh b/test/metaschema/fail_directory.sh index 599d01a1..7aff7e92 100755 --- a/test/metaschema/fail_directory.sh +++ b/test/metaschema/fail_directory.sh @@ -29,13 +29,13 @@ test "$CODE" = "1" || exit 1 cat << EOF > "$TMP/expected.txt" fail: $(realpath "$TMP")/schemas/schema_2.json error: Schema validation failure - The string value "object" was expected to equal one of the following values: "array", "boolean", "integer", "null", "number", "object", and "string" + The integer value 1 was expected to equal one of the following values: "array", "boolean", "integer", "null", "number", "object", and "string" at instance location "/type" at evaluate path "/properties/type/anyOf/0/\$ref/enum" The value was expected to consist of an array of at least 1 item at instance location "/type" at evaluate path "/properties/type/anyOf/1/type" - The string value was expected to validate against at least one of the 2 given subschemas + The integer value was expected to validate against at least one of the 2 given subschemas at instance location "/type" at evaluate path "/properties/type/anyOf" The object value was expected to validate against the 33 defined properties subschemas diff --git a/test/metaschema/fail_single.sh b/test/metaschema/fail_single.sh index 8125c728..f417d083 100755 --- a/test/metaschema/fail_single.sh +++ b/test/metaschema/fail_single.sh @@ -20,13 +20,13 @@ test "$CODE" = "1" || exit 1 cat << EOF > "$TMP/expected.txt" fail: $(realpath "$TMP")/schema.json error: Schema validation failure - The string value "object" was expected to equal one of the following values: "array", "boolean", "integer", "null", "number", "object", and "string" + The integer value 1 was expected to equal one of the following values: "array", "boolean", "integer", "null", "number", "object", and "string" at instance location "/type" at evaluate path "/properties/type/anyOf/0/\$ref/enum" The value was expected to consist of an array of at least 1 item at instance location "/type" at evaluate path "/properties/type/anyOf/1/type" - The string value was expected to validate against at least one of the 2 given subschemas + The integer value was expected to validate against at least one of the 2 given subschemas at instance location "/type" at evaluate path "/properties/type/anyOf" The object value was expected to validate against the 33 defined properties subschemas diff --git a/test/metaschema/pass_2020_12.sh b/test/metaschema/pass_2020_12.sh index b2a93e9d..c571ecad 100755 --- a/test/metaschema/pass_2020_12.sh +++ b/test/metaschema/pass_2020_12.sh @@ -10,7 +10,12 @@ trap clean EXIT cat << 'EOF' > "$TMP/schema.json" { "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "string" + "type": "string", + "$defs": { + "foo": { + "type": [ "string", "null" ] + } + } } EOF