Skip to content

Commit f37aa47

Browse files
Stranger6667Julian
authored andcommitted
Add tests for location-independent identifiers in remote ref
1 parent 84177bd commit f37aa47

File tree

5 files changed

+83
-0
lines changed

5 files changed

+83
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"refToInteger": {
3+
"$ref": "#foo"
4+
},
5+
"definitions": {
6+
"A": {
7+
"id": "#foo",
8+
"type": "integer"
9+
}
10+
}
11+
}

tests/draft2019-09/refRemote.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,23 @@
186186
"valid": true
187187
}
188188
]
189+
},
190+
{
191+
"description": "Location-independent identifier in remote ref",
192+
"schema": {
193+
"$ref": "http://localhost:1234/locationIndependentIdentifier.json#/refToInteger"
194+
},
195+
"tests": [
196+
{
197+
"description": "integer is valid",
198+
"data": 1,
199+
"valid": true
200+
},
201+
{
202+
"description": "string is invalid",
203+
"data": "foo",
204+
"valid": false
205+
}
206+
]
189207
}
190208
]

tests/draft4/refRemote.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,23 @@
167167
"valid": false
168168
}
169169
]
170+
},
171+
{
172+
"description": "Location-independent identifier in remote ref",
173+
"schema": {
174+
"$ref": "http://localhost:1234/locationIndependentIdentifier.json#/refToInteger"
175+
},
176+
"tests": [
177+
{
178+
"description": "integer is valid",
179+
"data": 1,
180+
"valid": true
181+
},
182+
{
183+
"description": "string is invalid",
184+
"data": "foo",
185+
"valid": false
186+
}
187+
]
170188
}
171189
]

tests/draft6/refRemote.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,23 @@
192192
"valid": true
193193
}
194194
]
195+
},
196+
{
197+
"description": "Location-independent identifier in remote ref",
198+
"schema": {
199+
"$ref": "http://localhost:1234/locationIndependentIdentifier.json#/refToInteger"
200+
},
201+
"tests": [
202+
{
203+
"description": "integer is valid",
204+
"data": 1,
205+
"valid": true
206+
},
207+
{
208+
"description": "string is invalid",
209+
"data": "foo",
210+
"valid": false
211+
}
212+
]
195213
}
196214
]

tests/draft7/refRemote.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,23 @@
192192
"valid": true
193193
}
194194
]
195+
},
196+
{
197+
"description": "Location-independent identifier in remote ref",
198+
"schema": {
199+
"$ref": "http://localhost:1234/locationIndependentIdentifier.json#/refToInteger"
200+
},
201+
"tests": [
202+
{
203+
"description": "integer is valid",
204+
"data": 1,
205+
"valid": true
206+
},
207+
{
208+
"description": "string is invalid",
209+
"data": "foo",
210+
"valid": false
211+
}
212+
]
195213
}
196214
]

0 commit comments

Comments
 (0)