Skip to content

Commit 827d2fc

Browse files
committed
[244] Add $schema tests that test presence in subschemas
1 parent e179a92 commit 827d2fc

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

tests/draft2019-09/meta/core.json

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,58 @@
4343
{
4444
"description": "Valid $schema",
4545
"data": {
46-
"$schema": "http://example.com/foo"
46+
"$schema": "https://json-schema.org/draft/2019-09/schema"
4747
},
4848
"valid": true
49+
},
50+
{
51+
"description": "$schema in subschema with no canonical ID: in allOf",
52+
"data": {
53+
"allOf": [
54+
{
55+
"$schema": "https://json-schema.org/draft/2019-09/schema"
56+
}
57+
]
58+
},
59+
"valid": false
60+
},
61+
{
62+
"description": "$schema in subschema with no canonical ID: in referenced",
63+
"data": {
64+
"$ref": "#/$defs/A",
65+
"$defs": {
66+
"A": {
67+
"$schema": "https://json-schema.org/draft/2019-09/schema"
68+
}
69+
}
70+
},
71+
"valid": false
72+
},
73+
{
74+
"description": "$schema in subschema with canonical ID: has $id",
75+
"data": {
76+
"$ref": "#/$defs/A",
77+
"$defs": {
78+
"A": {
79+
"$id": "other",
80+
"$schema": "https://json-schema.org/draft/2019-09/schema"
81+
}
82+
}
83+
},
84+
"valid": true
85+
},
86+
{
87+
"description": "$schema in subschema with canonical ID: has $anchor",
88+
"data": {
89+
"$ref": "#/$defs/A",
90+
"$defs": {
91+
"A": {
92+
"$anchor": "name",
93+
"$schema": "https://json-schema.org/draft/2019-09/schema"
94+
}
95+
}
96+
},
97+
"valid": false
4998
}
5099
]
51100
},

0 commit comments

Comments
 (0)