Skip to content

Commit b8f6336

Browse files
committed
Ensure discovery of subschemas in definitions even in newer dialects.
The JSON Schema specification, e.g. in 2020-12, uses SHOULD language here: implementations SHOULD assume that "$defs" and "definitions" have the same behavior when [the default] meta-schema is used. (from https://json-schema.org/draft/2020-12/json-schema-validation#name-keywords-moved-from-validat)
1 parent f1c5647 commit b8f6336

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"http://example.com/": {
5+
"definitions": {
6+
"foo": {
7+
"$id": "http://example.com/oh-hey-a-subschema",
8+
"abc": 123
9+
}
10+
}
11+
}
12+
},
13+
"tests": [
14+
{
15+
"ref": "http://example.com/oh-hey-a-subschema",
16+
"target": {
17+
"$id": "http://example.com/oh-hey-a-subschema",
18+
"abc": 123
19+
}
20+
}
21+
]
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "../../test-schema.json",
3+
"registry": {
4+
"http://example.com/": {
5+
"definitions": {
6+
"foo": {
7+
"$id": "http://example.com/oh-hey-a-subschema",
8+
"abc": 123
9+
}
10+
}
11+
}
12+
},
13+
"tests": [
14+
{
15+
"ref": "http://example.com/oh-hey-a-subschema",
16+
"target": {
17+
"$id": "http://example.com/oh-hey-a-subschema",
18+
"abc": 123
19+
}
20+
}
21+
]
22+
}

0 commit comments

Comments
 (0)