Skip to content

Commit

Permalink
Squashed 'json/' changes from 69acf529..fd9bcfbd
Browse files Browse the repository at this point in the history
fd9bcfbd Merge pull request #421 from willson-chen/bug601_addtestcase
13685a6c Forward port the nested ref test.
5be19e21 Give the nested ref schema a clearer name, and fix refs to it.
e9db2e58 subschema nested ref in remote ref

git-subtree-dir: json
git-subtree-split: fd9bcfbdb9a04a3203ad6b91140c8cf48836e44b
  • Loading branch information
Julian committed Jul 25, 2022
1 parent c09578b commit 999ff68
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 0 deletions.
6 changes: 6 additions & 0 deletions remotes/nested/foo-ref-string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "object",
"properties": {
"foo": {"$ref": "string.json"}
}
}
3 changes: 3 additions & 0 deletions remotes/nested/string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "string"
}
25 changes: 25 additions & 0 deletions tests/draft-next/refRemote.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,30 @@
"valid": false
}
]
},
{
"description": "retrieved nested refs resolve relative to their URI not $id",
"schema": {
"$id": "http://localhost:1234/some-id",
"properties": {
"name": {"$ref": "nested/foo-ref-string.json"}
}
},
"tests": [
{
"description": "number is invalid",
"data": {
"name": {"foo": 1}
},
"valid": false
},
{
"description": "string is valid",
"data": {
"name": {"foo": "a"}
},
"valid": true
}
]
}
]
25 changes: 25 additions & 0 deletions tests/draft2019-09/refRemote.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,30 @@
"valid": false
}
]
},
{
"description": "retrieved nested refs resolve relative to their URI not $id",
"schema": {
"$id": "http://localhost:1234/some-id",
"properties": {
"name": {"$ref": "nested/foo-ref-string.json"}
}
},
"tests": [
{
"description": "number is invalid",
"data": {
"name": {"foo": 1}
},
"valid": false
},
{
"description": "string is valid",
"data": {
"name": {"foo": "a"}
},
"valid": true
}
]
}
]
25 changes: 25 additions & 0 deletions tests/draft2020-12/refRemote.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,30 @@
"valid": false
}
]
},
{
"description": "retrieved nested refs resolve relative to their URI not $id",
"schema": {
"$id": "http://localhost:1234/some-id",
"properties": {
"name": {"$ref": "nested/foo-ref-string.json"}
}
},
"tests": [
{
"description": "number is invalid",
"data": {
"name": {"foo": 1}
},
"valid": false
},
{
"description": "string is valid",
"data": {
"name": {"foo": "a"}
},
"valid": true
}
]
}
]
25 changes: 25 additions & 0 deletions tests/draft6/refRemote.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,30 @@
"valid": false
}
]
},
{
"description": "retrieved nested refs resolve relative to their URI not $id",
"schema": {
"$id": "http://localhost:1234/some-id",
"properties": {
"name": {"$ref": "nested/foo-ref-string.json"}
}
},
"tests": [
{
"description": "number is invalid",
"data": {
"name": {"foo": 1}
},
"valid": false
},
{
"description": "string is valid",
"data": {
"name": {"foo": "a"}
},
"valid": true
}
]
}
]
25 changes: 25 additions & 0 deletions tests/draft7/refRemote.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,30 @@
"valid": false
}
]
},
{
"description": "retrieved nested refs resolve relative to their URI not $id",
"schema": {
"$id": "http://localhost:1234/some-id",
"properties": {
"name": {"$ref": "nested/foo-ref-string.json"}
}
},
"tests": [
{
"description": "number is invalid",
"data": {
"name": {"foo": 1}
},
"valid": false
},
{
"description": "string is valid",
"data": {
"name": {"foo": "a"}
},
"valid": true
}
]
}
]

0 comments on commit 999ff68

Please sign in to comment.