Skip to content

Commit 5be19e2

Browse files
committed
Give the nested ref schema a clearer name, and fix refs to it.
1 parent e9db2e5 commit 5be19e2

File tree

5 files changed

+31
-28
lines changed

5 files changed

+31
-28
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "object",
33
"properties": {
4-
"hole": {"$ref": "integer.json"}
4+
"foo": {"$ref": "string.json"}
55
}
66
}

remotes/nested/string.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "string"
3+
}

tests/draft2019-09/refRemote.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,27 +206,27 @@
206206
]
207207
},
208208
{
209-
"description": "subschema nested ref in remote ref",
209+
"description": "retrieved nested refs resolve relative to their URI not $id",
210210
"schema": {
211-
"$id": "http://localhost:1234/",
211+
"$id": "http://localhost:1234/some-id",
212212
"properties": {
213-
"name": {"$ref": "folder/subSchemaNestedRef.json"}
213+
"name": {"$ref": "nested/foo-ref-string.json"}
214214
}
215215
},
216216
"tests": [
217217
{
218-
"description": "number is valid",
218+
"description": "number is invalid",
219219
"data": {
220-
"name": {"hole": 1}
220+
"name": {"foo": 1}
221221
},
222-
"valid": true
222+
"valid": false
223223
},
224224
{
225-
"description": "string is invalid",
225+
"description": "string is valid",
226226
"data": {
227-
"name": {"hole": "a"}
227+
"name": {"foo": "a"}
228228
},
229-
"valid": false
229+
"valid": true
230230
}
231231
]
232232
}

tests/draft6/refRemote.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,27 +212,27 @@
212212
]
213213
},
214214
{
215-
"description": "subschema nested ref in remote ref",
215+
"description": "retrieved nested refs resolve relative to their URI not $id",
216216
"schema": {
217-
"$id": "http://localhost:1234/",
217+
"$id": "http://localhost:1234/some-id",
218218
"properties": {
219-
"name": {"$ref": "folder/subSchemaNestedRef.json"}
219+
"name": {"$ref": "nested/foo-ref-string.json"}
220220
}
221221
},
222222
"tests": [
223223
{
224-
"description": "number is valid",
224+
"description": "number is invalid",
225225
"data": {
226-
"name": {"hole": 1}
226+
"name": {"foo": 1}
227227
},
228-
"valid": true
228+
"valid": false
229229
},
230230
{
231-
"description": "string is invalid",
231+
"description": "string is valid",
232232
"data": {
233-
"name": {"hole": "a"}
233+
"name": {"foo": "a"}
234234
},
235-
"valid": false
235+
"valid": true
236236
}
237237
]
238238
}

tests/draft7/refRemote.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -212,27 +212,27 @@
212212
]
213213
},
214214
{
215-
"description": "subschema nested ref in remote ref",
215+
"description": "retrieved nested refs resolve relative to their URI not $id",
216216
"schema": {
217-
"$id": "http://localhost:1234/",
217+
"$id": "http://localhost:1234/some-id",
218218
"properties": {
219-
"name": {"$ref": "folder/subSchemaNestedRef.json"}
219+
"name": {"$ref": "nested/foo-ref-string.json"}
220220
}
221221
},
222222
"tests": [
223223
{
224-
"description": "number is valid",
224+
"description": "number is invalid",
225225
"data": {
226-
"name": {"hole": 1}
226+
"name": {"foo": 1}
227227
},
228-
"valid": true
228+
"valid": false
229229
},
230230
{
231-
"description": "string is invalid",
231+
"description": "string is valid",
232232
"data": {
233-
"name": {"hole": "a"}
233+
"name": {"foo": "a"}
234234
},
235-
"valid": false
235+
"valid": true
236236
}
237237
]
238238
}

0 commit comments

Comments
 (0)