Skip to content

Commit f82ef77

Browse files
committed
subschema nested ref in remote ref
1 parent ea41553 commit f82ef77

File tree

5 files changed

+83
-1
lines changed

5 files changed

+83
-1
lines changed

bin/jsonschema_suite

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,13 @@ REMOTES = {
5151
u"refToInteger": {u"$ref": u"#/$defs/integer"},
5252
}
5353
},
54-
"folder/folderInteger.json": {u"type": u"integer"}
54+
"folder/folderInteger.json": {u"type": u"integer"},
55+
"folder/subSchemaNestedRef.json": {
56+
u"type": u"object",
57+
u"properties": {
58+
u"hole": {u"$ref": u"integer.json"}
59+
}
60+
}
5561
}
5662
REMOTES_DIR = os.path.join(ROOT_DIR, "remotes")
5763

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const refs = {
77
'http://localhost:1234/integer.json': require('./remotes/integer.json'),
88
'http://localhost:1234/subSchemas.json': require('./remotes/subSchemas.json'),
99
'http://localhost:1234/folder/folderInteger.json': require('./remotes/folder/folderInteger.json'),
10+
'http://localhost:1234/folder/subSchemaNestedRef.json': require('./remotes/folder/subSchemaNestedRef.json'),
1011
'http://localhost:1234/name.json': require('./remotes/name.json'),
1112
'http://localhost:1234/name-defs.json': require('./remotes/name-defs.json')
1213
};

tests/draft2019-09/refRemote.json

+25
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,30 @@
163163
"valid": false
164164
}
165165
]
166+
},
167+
{
168+
"description": "subschema nested ref in remote ref",
169+
"schema": {
170+
"$id": "http://localhost:1234/",
171+
"properties": {
172+
"name": {"$ref": "folder/subSchemaNestedRef.json"}
173+
}
174+
},
175+
"tests": [
176+
{
177+
"description": "number is valid",
178+
"data": {
179+
"name": {"hole": 1}
180+
},
181+
"valid": true
182+
},
183+
{
184+
"description": "string is invalid",
185+
"data": {
186+
"name": {"hole": "a"}
187+
},
188+
"valid": false
189+
}
190+
]
166191
}
167192
]

tests/draft6/refRemote.json

+25
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,30 @@
167167
"valid": false
168168
}
169169
]
170+
},
171+
{
172+
"description": "subschema nested ref in remote ref",
173+
"schema": {
174+
"$id": "http://localhost:1234/",
175+
"properties": {
176+
"name": {"$ref": "folder/subSchemaNestedRef.json"}
177+
}
178+
},
179+
"tests": [
180+
{
181+
"description": "number is valid",
182+
"data": {
183+
"name": {"hole": 1}
184+
},
185+
"valid": true
186+
},
187+
{
188+
"description": "string is invalid",
189+
"data": {
190+
"name": {"hole": "a"}
191+
},
192+
"valid": false
193+
}
194+
]
170195
}
171196
]

tests/draft7/refRemote.json

+25
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,30 @@
167167
"valid": false
168168
}
169169
]
170+
},
171+
{
172+
"description": "subschema nested ref in remote ref",
173+
"schema": {
174+
"$id": "http://localhost:1234/",
175+
"properties": {
176+
"name": {"$ref": "folder/subSchemaNestedRef.json"}
177+
}
178+
},
179+
"tests": [
180+
{
181+
"description": "number is valid",
182+
"data": {
183+
"name": {"hole": 1}
184+
},
185+
"valid": true
186+
},
187+
{
188+
"description": "string is invalid",
189+
"data": {
190+
"name": {"hole": "a"}
191+
},
192+
"valid": false
193+
}
194+
]
170195
}
171196
]

0 commit comments

Comments
 (0)