Skip to content

Commit a884acc

Browse files
committed
draft-04/06: base URI change tests
1 parent ed3391c commit a884acc

File tree

2 files changed

+130
-6
lines changed

2 files changed

+130
-6
lines changed

tests/draft4/refRemote.json

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
]
5151
},
5252
{
53-
"description": "change resolution scope",
53+
"description": "base URI change",
5454
"schema": {
5555
"id": "http://localhost:1234/",
5656
"items": {
@@ -60,15 +60,77 @@
6060
},
6161
"tests": [
6262
{
63-
"description": "changed scope ref valid",
63+
"description": "base URI change ref valid",
6464
"data": [[1]],
6565
"valid": true
6666
},
6767
{
68-
"description": "changed scope ref invalid",
68+
"description": "base URI change ref invalid",
6969
"data": [["a"]],
7070
"valid": false
7171
}
7272
]
73+
},
74+
{
75+
"description": "base URI change - change folder",
76+
"schema": {
77+
"id": "http://localhost:1234/scope_change_defs1.json",
78+
"type" : "object",
79+
"properties": {
80+
"list": {"$ref": "#/definitions/baz"}
81+
},
82+
"definitions": {
83+
"baz": {
84+
"id": "folder/",
85+
"type": "array",
86+
"items": {"$ref": "folderInteger.json"}
87+
}
88+
}
89+
},
90+
"tests": [
91+
{
92+
"description": "number is valid",
93+
"data": {"list": [1]},
94+
"valid": true
95+
},
96+
{
97+
"description": "string is invalid",
98+
"data": {"list": ["a"]},
99+
"valid": false
100+
}
101+
]
102+
},
103+
{
104+
"description": "base URI change - change folder in subschema",
105+
"schema": {
106+
"id": "http://localhost:1234/scope_change_defs2.json",
107+
"type" : "object",
108+
"properties": {
109+
"list": {"$ref": "#/definitions/baz/definitions/bar"}
110+
},
111+
"definitions": {
112+
"baz": {
113+
"id": "folder/",
114+
"definitions": {
115+
"bar": {
116+
"type": "array",
117+
"items": {"$ref": "folderInteger.json"}
118+
}
119+
}
120+
}
121+
}
122+
},
123+
"tests": [
124+
{
125+
"description": "number is valid",
126+
"data": {"list": [1]},
127+
"valid": true
128+
},
129+
{
130+
"description": "string is invalid",
131+
"data": {"list": ["a"]},
132+
"valid": false
133+
}
134+
]
73135
}
74136
]

tests/draft6/refRemote.json

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
]
5151
},
5252
{
53-
"description": "change resolution scope",
53+
"description": "base URI change",
5454
"schema": {
5555
"id": "http://localhost:1234/",
5656
"items": {
@@ -60,15 +60,77 @@
6060
},
6161
"tests": [
6262
{
63-
"description": "changed scope ref valid",
63+
"description": "base URI change ref valid",
6464
"data": [[1]],
6565
"valid": true
6666
},
6767
{
68-
"description": "changed scope ref invalid",
68+
"description": "base URI change ref invalid",
6969
"data": [["a"]],
7070
"valid": false
7171
}
7272
]
73+
},
74+
{
75+
"description": "base URI change - change folder",
76+
"schema": {
77+
"id": "http://localhost:1234/scope_change_defs1.json",
78+
"type" : "object",
79+
"properties": {
80+
"list": {"$ref": "#/definitions/baz"}
81+
},
82+
"definitions": {
83+
"baz": {
84+
"id": "folder/",
85+
"type": "array",
86+
"items": {"$ref": "folderInteger.json"}
87+
}
88+
}
89+
},
90+
"tests": [
91+
{
92+
"description": "number is valid",
93+
"data": {"list": [1]},
94+
"valid": true
95+
},
96+
{
97+
"description": "string is invalid",
98+
"data": {"list": ["a"]},
99+
"valid": false
100+
}
101+
]
102+
},
103+
{
104+
"description": "base URI change - change folder in subschema",
105+
"schema": {
106+
"id": "http://localhost:1234/scope_change_defs2.json",
107+
"type" : "object",
108+
"properties": {
109+
"list": {"$ref": "#/definitions/baz/definitions/bar"}
110+
},
111+
"definitions": {
112+
"baz": {
113+
"id": "folder/",
114+
"definitions": {
115+
"bar": {
116+
"type": "array",
117+
"items": {"$ref": "folderInteger.json"}
118+
}
119+
}
120+
}
121+
}
122+
},
123+
"tests": [
124+
{
125+
"description": "number is valid",
126+
"data": {"list": [1]},
127+
"valid": true
128+
},
129+
{
130+
"description": "string is invalid",
131+
"data": {"list": ["a"]},
132+
"valid": false
133+
}
134+
]
73135
}
74136
]

0 commit comments

Comments
 (0)