boon now included
This commit is contained in:
244
validator/tests/invalid-schemas.json
Normal file
244
validator/tests/invalid-schemas.json
Normal file
@ -0,0 +1,244 @@
|
||||
[
|
||||
{
|
||||
"description": "InvalidJsonPointer",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$ref": "#/a~0b~~cd"
|
||||
},
|
||||
"errors": [
|
||||
"InvalidJsonPointer(\"http://fake.com/schema.json#/a~0b~~cd\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "UnsupportedUrlScheme",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$ref": "ftp://mars.com/schema.json"
|
||||
},
|
||||
"errors": [
|
||||
"UnsupportedUrlScheme { url: \"ftp://mars.com/schema.json\" }"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ValidationError",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"patternProperties": {
|
||||
"^(abc]": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"ValidationError { url: \"http://fake.com/schema.json#\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "ValidationError-nonsubschema",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"dummy": {
|
||||
"type": 1
|
||||
},
|
||||
"$ref": "#/dummy"
|
||||
},
|
||||
"errors": [
|
||||
"ValidationError { url: \"http://fake.com/schema.json#/dummy\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "JsonPointerNotFound-obj",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$ref": "#/$defs/something"
|
||||
},
|
||||
"errors": [
|
||||
"JsonPointerNotFound(\"http://fake.com/schema.json#/$defs/something\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "JsonPointerNotFound-arr-pos",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$ref": "#/dummy/0",
|
||||
"dummy": []
|
||||
},
|
||||
"errors": [
|
||||
"JsonPointerNotFound(\"http://fake.com/schema.json#/dummy/0\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "JsonPointerNotFound-arr-neg",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$ref": "#/dummy/-1",
|
||||
"dummy": []
|
||||
},
|
||||
"errors": [
|
||||
"JsonPointerNotFound(\"http://fake.com/schema.json#/dummy/-1\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "JsonPointerNotFound-primitive",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$ref": "#/$schema/something"
|
||||
},
|
||||
"errors": [
|
||||
"JsonPointerNotFound(\"http://fake.com/schema.json#/$schema/something\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "InvalidRegex",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft-04/schema",
|
||||
"patternProperties": {
|
||||
"^(abc]": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"InvalidRegex { url: \"http://fake.com/schema.json#/patternProperties\", regex: \"^(abc]\", "
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "DuplicateId",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$defs": {
|
||||
"a": {
|
||||
"$id": "http://a.com/b",
|
||||
"$defs": {
|
||||
"b": {
|
||||
"$id": "a.json"
|
||||
},
|
||||
"c": {
|
||||
"$id": "a.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"DuplicateId { url: \"http://fake.com/schema.json\", id: \"http://a.com/a.json\", ",
|
||||
"\"/$defs/a/$defs/b\"",
|
||||
"\"/$defs/a/$defs/c\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "DuplicateAnchor",
|
||||
"schema": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$defs": {
|
||||
"a": {
|
||||
"$id": "http://a.com/b",
|
||||
"$defs": {
|
||||
"b": {
|
||||
"$anchor": "a1"
|
||||
},
|
||||
"c": {
|
||||
"$anchor": "a1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"DuplicateAnchor { anchor: \"a1\", url: \"http://fake.com/schema.json\", ",
|
||||
"\"/$defs/a/$defs/b\"",
|
||||
"\"/$defs/a/$defs/c\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "UnsupportedDraft",
|
||||
"remotes": {
|
||||
"http://remotes/a.json": {
|
||||
"$schema": "http://remotes/b.json"
|
||||
},
|
||||
"http://remotes/b.json": {
|
||||
"$schema": "http://remotes/b.json"
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$schema": "http://remotes/a.json"
|
||||
},
|
||||
"errors": [
|
||||
"UnsupportedDraft { url: \"http://remotes/b.json\" }"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "MetaSchemaCycle",
|
||||
"remotes": {
|
||||
"http://remotes/a.json": {
|
||||
"$schema": "http://remotes/b.json"
|
||||
},
|
||||
"http://remotes/b.json": {
|
||||
"$schema": "http://remotes/a.json"
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$schema": "http://remotes/a.json"
|
||||
},
|
||||
"errors": [
|
||||
"MetaSchemaCycle { url: \"http://remotes/a.json\" }"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "AnchorNotFound-local",
|
||||
"schema": {
|
||||
"$ref": "sample.json#abcd",
|
||||
"$defs": {
|
||||
"a": {
|
||||
"$id": "sample.json"
|
||||
}
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"AnchorNotFound { url: \"http://fake.com/schema.json\", reference: \"http://fake.com/sample.json#abcd\" }"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "AnchorNotFound-remote",
|
||||
"remotes": {
|
||||
"http://remotes/a.json": {}
|
||||
},
|
||||
"schema": {
|
||||
"$ref": "http://remotes/a.json#abcd"
|
||||
},
|
||||
"errors": [
|
||||
"AnchorNotFound { url: \"http://remotes/a.json\", reference: \"http://remotes/a.json#abcd\" }"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "UnsupportedVocabulary-required",
|
||||
"remotes": {
|
||||
"http://remotes/a.json": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema#",
|
||||
"$vocabulary": {
|
||||
"https://json-schema.org/draft/2019-09/vocab/format": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$schema": "http://remotes/a.json"
|
||||
},
|
||||
"errors": [
|
||||
"UnsupportedVocabulary { url: \"http://remotes/a.json\", vocabulary: \"https://json-schema.org/draft/2019-09/vocab/format\" }"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "UnsupportedVocabulary-optioanl",
|
||||
"remotes": {
|
||||
"http://remotes/a.json": {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema#",
|
||||
"$vocabulary": {
|
||||
"https://json-schema.org/draft/2019-09/vocab/format": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"schema": {
|
||||
"$schema": "http://remotes/a.json"
|
||||
}
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user