Skip to content

Commit 6e5d45d

Browse files
authored
Merge pull request #646 from santhosh-tekuri/vocab-optional
test/vocabulary: ignore unrecognized optional vocabulary
2 parents 0311dfd + 880c993 commit 6e5d45d

File tree

6 files changed

+98
-2
lines changed

6 files changed

+98
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/next/schema",
3+
"$id": "http://localhost:1234/draft-next/metaschema-optional-vocabulary.json",
4+
"$vocabulary": {
5+
"https://json-schema.org/draft/next/vocab/validation": true,
6+
"https://json-schema.org/draft/next/vocab/core": true,
7+
"http://localhost:1234/draft/next/vocab/custom": false
8+
},
9+
"allOf": [
10+
{ "$ref": "https://json-schema.org/draft/next/meta/validation" },
11+
{ "$ref": "https://json-schema.org/draft/next/meta/core" }
12+
]
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2019-09/schema",
3+
"$id": "http://localhost:1234/draft2019-09/metaschema-optional-vocabulary.json",
4+
"$vocabulary": {
5+
"https://json-schema.org/draft/2019-09/vocab/validation": true,
6+
"https://json-schema.org/draft/2019-09/vocab/core": true,
7+
"http://localhost:1234/draft/2019-09/vocab/custom": false
8+
},
9+
"allOf": [
10+
{ "$ref": "https://json-schema.org/draft/2019-09/meta/validation" },
11+
{ "$ref": "https://json-schema.org/draft/2019-09/meta/core" }
12+
]
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "http://localhost:1234/draft2020-12/metaschema-optional-vocabulary.json",
4+
"$vocabulary": {
5+
"https://json-schema.org/draft/2020-12/vocab/validation": true,
6+
"https://json-schema.org/draft/2020-12/vocab/core": true,
7+
"http://localhost:1234/draft/2020-12/vocab/custom": false
8+
},
9+
"allOf": [
10+
{ "$ref": "https://json-schema.org/draft/2020-12/meta/validation" },
11+
{ "$ref": "https://json-schema.org/draft/2020-12/meta/core" }
12+
]
13+
}

tests/draft-next/vocabulary.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,24 @@
3434
"valid": true
3535
}
3636
]
37-
}
37+
},
38+
{
39+
"description": "ignore unrecognized optional vocabulary",
40+
"schema": {
41+
"$schema": "http://localhost:1234/draft-next/metaschema-optional-vocabulary.json",
42+
"type": "number"
43+
},
44+
"tests": [
45+
{
46+
"description": "string value",
47+
"data": "foobar",
48+
"valid": false
49+
},
50+
{
51+
"description": "number value",
52+
"data": 20,
53+
"valid": true
54+
}
55+
]
56+
}
3857
]

tests/draft2019-09/vocabulary.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,24 @@
3434
"valid": true
3535
}
3636
]
37-
}
37+
},
38+
{
39+
"description": "ignore unrecognized optional vocabulary",
40+
"schema": {
41+
"$schema": "http://localhost:1234/draft2019-09/metaschema-optional-vocabulary.json",
42+
"type": "number"
43+
},
44+
"tests": [
45+
{
46+
"description": "string value",
47+
"data": "foobar",
48+
"valid": false
49+
},
50+
{
51+
"description": "number value",
52+
"data": 20,
53+
"valid": true
54+
}
55+
]
56+
}
3857
]

tests/draft2020-12/vocabulary.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,24 @@
3434
"valid": true
3535
}
3636
]
37+
},
38+
{
39+
"description": "ignore unrecognized optional vocabulary",
40+
"schema": {
41+
"$schema": "http://localhost:1234/draft2020-12/metaschema-optional-vocabulary.json",
42+
"type": "number"
43+
},
44+
"tests": [
45+
{
46+
"description": "string value",
47+
"data": "foobar",
48+
"valid": false
49+
},
50+
{
51+
"description": "number value",
52+
"data": 20,
53+
"valid": true
54+
}
55+
]
3756
}
3857
]

0 commit comments

Comments
 (0)