Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02
core https://github.com/sourcemeta/core e00d491e5140054956403fed5e8d892cd066ad9d
jsonbinpack https://github.com/sourcemeta/jsonbinpack 56dd83ba8483391a694c017ceceafa46cf743259
blaze https://github.com/sourcemeta/blaze bd450a8ec5c3e7ca4c32620a9dc4fb8ae05d1606
blaze https://github.com/sourcemeta/blaze ea74ae79a59869aa7ff9d16182fa2b0e5426a088
hydra https://github.com/sourcemeta/hydra 38206da873311f0d1fc5f851a9c38838459e89b9
178 changes: 89 additions & 89 deletions test/ci/pass_bundle_http.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ cat << EOF > "$TMP/expected.json"
"default": {},
"type": "object",
"properties": {
"\$schema": {
"id": {
"type": "string"
},
"id": {
"\$schema": {
"type": "string"
},
"title": {
Expand All @@ -48,135 +48,107 @@ cat << EOF > "$TMP/expected.json"
"type": "string"
},
"default": {},
"type": {
"anyOf": [
{
"\$ref": "#/definitions/simpleTypes"
},
{
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"\$ref": "#/definitions/simpleTypes"
}
}
]
},
"enum": {
"type": "array",
"minItems": 1,
"uniqueItems": true
},
"allOf": {
"\$ref": "#/definitions/schemaArray"
},
"anyOf": {
"\$ref": "#/definitions/schemaArray"
},
"oneOf": {
"\$ref": "#/definitions/schemaArray"
"multipleOf": {
"type": "number",
"exclusiveMinimum": true,
"minimum": 0
},
"not": {
"\$ref": "#"
"maximum": {
"type": "number"
},
"exclusiveMaximum": {
"default": false,
"type": "boolean"
},
"maximum": {
"minimum": {
"type": "number"
},
"exclusiveMinimum": {
"default": false,
"type": "boolean"
},
"minimum": {
"type": "number"
},
"multipleOf": {
"type": "number",
"exclusiveMinimum": true,
"minimum": 0
},
"pattern": {
"type": "string",
"format": "regex"
},
"format": {
"type": "string"
},
"maxLength": {
"\$ref": "#/definitions/positiveInteger"
},
"minLength": {
"\$ref": "#/definitions/positiveIntegerDefault0"
},
"maxItems": {
"\$ref": "#/definitions/positiveInteger"
},
"minItems": {
"\$ref": "#/definitions/positiveIntegerDefault0"
},
"uniqueItems": {
"default": false,
"type": "boolean"
"pattern": {
"type": "string",
"format": "regex"
},
"items": {
"additionalItems": {
"default": {},
"anyOf": [
{
"\$ref": "#"
"type": "boolean"
},
{
"\$ref": "#/definitions/schemaArray"
"\$ref": "#"
}
]
},
"additionalItems": {
"items": {
"default": {},
"anyOf": [
{
"type": "boolean"
"\$ref": "#"
},
{
"\$ref": "#"
"\$ref": "#/definitions/schemaArray"
}
]
},
"required": {
"\$ref": "#/definitions/stringArray"
"maxItems": {
"\$ref": "#/definitions/positiveInteger"
},
"minItems": {
"\$ref": "#/definitions/positiveIntegerDefault0"
},
"uniqueItems": {
"default": false,
"type": "boolean"
},
"maxProperties": {
"\$ref": "#/definitions/positiveInteger"
},
"minProperties": {
"\$ref": "#/definitions/positiveIntegerDefault0"
},
"properties": {
"required": {
"\$ref": "#/definitions/stringArray"
},
"additionalProperties": {
"default": {},
"anyOf": [
{
"type": "boolean"
},
{
"\$ref": "#"
}
]
},
"definitions": {
"default": {},
"type": "object",
"additionalProperties": {
"\$ref": "#"
}
},
"patternProperties": {
"properties": {
"default": {},
"type": "object",
"additionalProperties": {
"\$ref": "#"
}
},
"additionalProperties": {
"patternProperties": {
"default": {},
"anyOf": [
{
"type": "boolean"
},
{
"\$ref": "#"
}
]
"type": "object",
"additionalProperties": {
"\$ref": "#"
}
},
"dependencies": {
"type": "object",
Expand All @@ -191,19 +163,54 @@ cat << EOF > "$TMP/expected.json"
]
}
},
"definitions": {
"default": {},
"type": "object",
"additionalProperties": {
"\$ref": "#"
}
"enum": {
"type": "array",
"minItems": 1,
"uniqueItems": true
},
"type": {
"anyOf": [
{
"\$ref": "#/definitions/simpleTypes"
},
{
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"\$ref": "#/definitions/simpleTypes"
}
}
]
},
"format": {
"type": "string"
},
"allOf": {
"\$ref": "#/definitions/schemaArray"
},
"anyOf": {
"\$ref": "#/definitions/schemaArray"
},
"oneOf": {
"\$ref": "#/definitions/schemaArray"
},
"not": {
"\$ref": "#"
}
},
"dependencies": {
"exclusiveMaximum": [ "maximum" ],
"exclusiveMinimum": [ "minimum" ]
},
"definitions": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": {
"\$ref": "#"
}
},
"positiveInteger": {
"type": "integer",
"minimum": 0
Expand All @@ -218,13 +225,6 @@ cat << EOF > "$TMP/expected.json"
}
]
},
"schemaArray": {
"type": "array",
"minItems": 1,
"items": {
"\$ref": "#"
}
},
"simpleTypes": {
"enum": [
"array",
Expand Down
10 changes: 9 additions & 1 deletion test/metaschema/fail_directory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ test "$CODE" = "2" || exit 1
cat << EOF > "$TMP/expected.txt"
fail: $(realpath "$TMP")/schemas/schema_2.json
error: Schema validation failure
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" (line 3, column 3)
at evaluate path "/properties/type/anyOf/0/\$ref/enum"
The integer value was expected to validate against the statically referenced schema
at instance location "/type" (line 3, column 3)
at evaluate path "/properties/type/anyOf/0/\$ref"
The value was expected to be of type array but it was of type integer
at instance location "/type" (line 3, column 3)
at evaluate path "/properties/type/anyOf/1/type"
The integer value was expected to validate against at least one of the 2 given subschemas
at instance location "/type" (line 3, column 3)
at evaluate path "/properties/type/anyOf"
Expand All @@ -38,4 +47,3 @@ error: Schema validation failure
EOF

diff "$TMP/stderr.txt" "$TMP/expected.txt"

22 changes: 21 additions & 1 deletion test/metaschema/fail_directory_json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ $(realpath "$TMP")/schemas/schema_2.json
{
"valid": false,
"errors": [
{
"keywordLocation": "/properties/type/anyOf/0/\$ref/enum",
"absoluteKeywordLocation": "http://json-schema.org/draft-04/schema#/definitions/simpleTypes/enum",
"instanceLocation": "/type",
"instancePosition": [ 3, 3, 3, 11 ],
"error": "The integer value 1 was expected to equal one of the following values: \"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", and \"string\""
},
{
"keywordLocation": "/properties/type/anyOf/0/\$ref",
"absoluteKeywordLocation": "http://json-schema.org/draft-04/schema#/properties/type/anyOf/0/\$ref",
"instanceLocation": "/type",
"instancePosition": [ 3, 3, 3, 11 ],
"error": "The integer value was expected to validate against the statically referenced schema"
},
{
"keywordLocation": "/properties/type/anyOf/1/type",
"absoluteKeywordLocation": "http://json-schema.org/draft-04/schema#/properties/type/anyOf/1/type",
"instanceLocation": "/type",
"instancePosition": [ 3, 3, 3, 11 ],
"error": "The value was expected to be of type array but it was of type integer"
},
{
"keywordLocation": "/properties/type/anyOf",
"absoluteKeywordLocation": "http://json-schema.org/draft-04/schema#/properties/type/anyOf",
Expand All @@ -54,4 +75,3 @@ $(realpath "$TMP")/schemas/schema_2.json
EOF

diff "$TMP/output.txt" "$TMP/expected.txt"

21 changes: 21 additions & 0 deletions test/metaschema/fail_json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ cat << EOF > "$TMP/expected.json"
{
"valid": false,
"errors": [
{
"keywordLocation": "/properties/type/anyOf/0/\$ref/enum",
"absoluteKeywordLocation": "http://json-schema.org/draft-04/schema#/definitions/simpleTypes/enum",
"instanceLocation": "/type",
"instancePosition": [ 3, 3, 3, 11 ],
"error": "The integer value 1 was expected to equal one of the following values: \"array\", \"boolean\", \"integer\", \"null\", \"number\", \"object\", and \"string\""
},
{
"keywordLocation": "/properties/type/anyOf/0/\$ref",
"absoluteKeywordLocation": "http://json-schema.org/draft-04/schema#/properties/type/anyOf/0/\$ref",
"instanceLocation": "/type",
"instancePosition": [ 3, 3, 3, 11 ],
"error": "The integer value was expected to validate against the statically referenced schema"
},
{
"keywordLocation": "/properties/type/anyOf/1/type",
"absoluteKeywordLocation": "http://json-schema.org/draft-04/schema#/properties/type/anyOf/1/type",
"instanceLocation": "/type",
"instancePosition": [ 3, 3, 3, 11 ],
"error": "The value was expected to be of type array but it was of type integer"
},
{
"keywordLocation": "/properties/type/anyOf",
"absoluteKeywordLocation": "http://json-schema.org/draft-04/schema#/properties/type/anyOf",
Expand Down
9 changes: 9 additions & 0 deletions test/metaschema/fail_single.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ test "$CODE" = "2" || exit 1
cat << EOF > "$TMP/expected.txt"
fail: $(realpath "$TMP")/schema.json
error: Schema validation failure
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" (line 3, column 3)
at evaluate path "/properties/type/anyOf/0/\$ref/enum"
The integer value was expected to validate against the statically referenced schema
at instance location "/type" (line 3, column 3)
at evaluate path "/properties/type/anyOf/0/\$ref"
The value was expected to be of type array but it was of type integer
at instance location "/type" (line 3, column 3)
at evaluate path "/properties/type/anyOf/1/type"
The integer value was expected to validate against at least one of the 2 given subschemas
at instance location "/type" (line 3, column 3)
at evaluate path "/properties/type/anyOf"
Expand Down
9 changes: 9 additions & 0 deletions test/metaschema/fail_yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ test "$CODE" = "2" || exit 1
cat << EOF > "$TMP/expected.txt"
fail: $(realpath "$TMP")/schema.yaml
error: Schema validation failure
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" (line 2, column 1)
at evaluate path "/properties/type/anyOf/0/\$ref/enum"
The integer value was expected to validate against the statically referenced schema
at instance location "/type" (line 2, column 1)
at evaluate path "/properties/type/anyOf/0/\$ref"
The value was expected to be of type array but it was of type integer
at instance location "/type" (line 2, column 1)
at evaluate path "/properties/type/anyOf/1/type"
The integer value was expected to validate against at least one of the 2 given subschemas
at instance location "/type" (line 2, column 1)
at evaluate path "/properties/type/anyOf"
Expand Down
Loading
Loading