Skip to content

Commit b5123d1

Browse files
jgraettingerJulian
authored andcommitted
In draft2019-09, you cannot reference arbitrary locations.
1 parent 35041a3 commit b5123d1

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

remotes/subSchemas.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
2-
"integer": {
3-
"type": "integer"
4-
},
5-
"refToInteger": {
6-
"$ref": "#/integer"
2+
"$defs": {
3+
"integer": {
4+
"type": "integer"
5+
},
6+
"refToInteger": {
7+
"$ref": "#/$defs/integer"
8+
}
79
}
810
}

tests/draft2019-09/ref.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,21 @@
7575
{
7676
"description": "escaped pointer ref",
7777
"schema": {
78-
"tilda~field": {"type": "integer"},
79-
"slash/field": {"type": "integer"},
80-
"percent%field": {"type": "integer"},
78+
"$defs": {
79+
"tilda~field": {
80+
"type": "integer"
81+
},
82+
"slash/field": {
83+
"type": "integer"
84+
},
85+
"percent%field": {
86+
"type": "integer"
87+
}
88+
},
8189
"properties": {
82-
"tilda": {"$ref": "#/tilda~0field"},
83-
"slash": {"$ref": "#/slash~1field"},
84-
"percent": {"$ref": "#/percent%25field"}
90+
"tilda": {"$ref": "#/$defs/tilda~0field"},
91+
"slash": {"$ref": "#/$defs/slash~1field"},
92+
"percent": {"$ref": "#/$defs/percent%25field"}
8593
}
8694
},
8795
"tests": [

tests/draft2019-09/refRemote.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
{
1919
"description": "fragment within remote ref",
20-
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
20+
"schema": {"$ref": "http://localhost:1234/subSchemas.json#/$defs/integer"},
2121
"tests": [
2222
{
2323
"description": "remote fragment valid",
@@ -34,7 +34,7 @@
3434
{
3535
"description": "ref within remote ref",
3636
"schema": {
37-
"$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
37+
"$ref": "http://localhost:1234/subSchemas.json#/$defs/refToInteger"
3838
},
3939
"tests": [
4040
{
@@ -76,7 +76,7 @@
7676
"schema": {
7777
"$id": "http://localhost:1234/scope_change_defs1.json",
7878
"type" : "object",
79-
"properties": {"list": {"$ref": "#/$defs/baz"}},
79+
"properties": {"list": {"$ref": "folder/"}},
8080
"$defs": {
8181
"baz": {
8282
"$id": "folder/",
@@ -103,7 +103,7 @@
103103
"schema": {
104104
"$id": "http://localhost:1234/scope_change_defs2.json",
105105
"type" : "object",
106-
"properties": {"list": {"$ref": "#/$defs/baz/$defs/bar"}},
106+
"properties": {"list": {"$ref": "folder/#/$defs/bar"}},
107107
"$defs": {
108108
"baz": {
109109
"$id": "folder/",

0 commit comments

Comments
 (0)