Skip to content

Commit 13685a6

Browse files
committed
Forward port the nested ref test.
1 parent 5be19e2 commit 13685a6

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

tests/draft-next/refRemote.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,30 @@
204204
"valid": false
205205
}
206206
]
207+
},
208+
{
209+
"description": "retrieved nested refs resolve relative to their URI not $id",
210+
"schema": {
211+
"$id": "http://localhost:1234/some-id",
212+
"properties": {
213+
"name": {"$ref": "nested/foo-ref-string.json"}
214+
}
215+
},
216+
"tests": [
217+
{
218+
"description": "number is invalid",
219+
"data": {
220+
"name": {"foo": 1}
221+
},
222+
"valid": false
223+
},
224+
{
225+
"description": "string is valid",
226+
"data": {
227+
"name": {"foo": "a"}
228+
},
229+
"valid": true
230+
}
231+
]
207232
}
208233
]

tests/draft2020-12/refRemote.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,30 @@
204204
"valid": false
205205
}
206206
]
207+
},
208+
{
209+
"description": "retrieved nested refs resolve relative to their URI not $id",
210+
"schema": {
211+
"$id": "http://localhost:1234/some-id",
212+
"properties": {
213+
"name": {"$ref": "nested/foo-ref-string.json"}
214+
}
215+
},
216+
"tests": [
217+
{
218+
"description": "number is invalid",
219+
"data": {
220+
"name": {"foo": 1}
221+
},
222+
"valid": false
223+
},
224+
{
225+
"description": "string is valid",
226+
"data": {
227+
"name": {"foo": "a"}
228+
},
229+
"valid": true
230+
}
231+
]
207232
}
208233
]

0 commit comments

Comments
 (0)