Skip to content

Commit b78dd91

Browse files
committed
[300] Add tests for valid use of empty fragments in "$id"
1 parent 429cf82 commit b78dd91

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/draft2019-09/id.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,45 @@
9494
"valid": false
9595
}
9696
]
97+
},
98+
{
99+
"description": "Valid use of empty fragments in location-independent $id",
100+
"schema": {
101+
"$ref": "https://json-schema.org/draft/2019-09/schema"
102+
},
103+
"tests": [
104+
{
105+
"description": "Identifier name with absolute URI",
106+
"data": {
107+
"$ref": "http://localhost:1234/bar",
108+
"$defs": {
109+
"A": {
110+
"$id": "http://localhost:1234/bar#",
111+
"type": "integer"
112+
}
113+
}
114+
},
115+
"valid": true
116+
},
117+
{
118+
"description": "Identifier name with base URI change in subschema",
119+
"data": {
120+
"$id": "http://localhost:1234/root",
121+
"$ref": "http://localhost:1234/nested.json#/$defs/B",
122+
"$defs": {
123+
"A": {
124+
"$id": "nested.json",
125+
"$defs": {
126+
"B": {
127+
"$id": "#",
128+
"type": "integer"
129+
}
130+
}
131+
}
132+
}
133+
},
134+
"valid": true
135+
}
136+
]
97137
}
98138
]

0 commit comments

Comments
 (0)