File tree 4 files changed +144
-0
lines changed
4 files changed +144
-0
lines changed Original file line number Diff line number Diff line change 200
200
}
201
201
]
202
202
},
203
+ {
204
+ "description" : " $ref prevents a sibling $id from changing the base uri" ,
205
+ "schema" : {
206
+ "$id" : " http://localhost:1234/sibling_id/base/" ,
207
+ "definitions" : {
208
+ "foo" : {
209
+ "$id" : " http://localhost:1234/sibling_id/foo.json" ,
210
+ "minimum" : 2
211
+ },
212
+ "base_foo" : {
213
+ "$comment" : " this canonical uri is http://localhost:1234/sibling_id/base/foo.json" ,
214
+ "$id" : " foo.json" ,
215
+ "minimum" : 5
216
+ }
217
+ },
218
+ "allOf" : [
219
+ {
220
+ "$comment" : " $ref resolves to http://localhost:1234/sibling_id/base/foo.json, not ttp://localhost:1234/sibling_id/foo.json" ,
221
+ "$id" : " http://localhost:1234/sibling_id/" ,
222
+ "$ref" : " foo.json"
223
+ }
224
+ ]
225
+ },
226
+ "tests" : [
227
+ {
228
+ "description" : " $ref resolves to /definitions/foo, data validates" ,
229
+ "data" : 10 ,
230
+ "valid" : true
231
+ },
232
+ {
233
+ "description" : " $ref resolves to /definitions/foo, data does not validate" ,
234
+ "data" : 1 ,
235
+ "valid" : false
236
+ }
237
+ ]
238
+ },
203
239
{
204
240
"description" : " remote ref, containing refs itself" ,
205
241
"schema" : {"$ref" : " http://json-schema.org/draft-03/schema#" },
Original file line number Diff line number Diff line change 175
175
}
176
176
]
177
177
},
178
+ {
179
+ "description" : " $ref prevents a sibling $id from changing the base uri" ,
180
+ "schema" : {
181
+ "$id" : " http://localhost:1234/sibling_id/base/" ,
182
+ "definitions" : {
183
+ "foo" : {
184
+ "$id" : " http://localhost:1234/sibling_id/foo.json" ,
185
+ "minimum" : 2
186
+ },
187
+ "base_foo" : {
188
+ "$comment" : " this canonical uri is http://localhost:1234/sibling_id/base/foo.json" ,
189
+ "$id" : " foo.json" ,
190
+ "minimum" : 5
191
+ }
192
+ },
193
+ "allOf" : [
194
+ {
195
+ "$comment" : " $ref resolves to http://localhost:1234/sibling_id/base/foo.json, not ttp://localhost:1234/sibling_id/foo.json" ,
196
+ "$id" : " http://localhost:1234/sibling_id/" ,
197
+ "$ref" : " foo.json"
198
+ }
199
+ ]
200
+ },
201
+ "tests" : [
202
+ {
203
+ "description" : " $ref resolves to /definitions/foo, data validates" ,
204
+ "data" : 10 ,
205
+ "valid" : true
206
+ },
207
+ {
208
+ "description" : " $ref resolves to /definitions/foo, data does not validate" ,
209
+ "data" : 1 ,
210
+ "valid" : false
211
+ }
212
+ ]
213
+ },
178
214
{
179
215
"description" : " remote ref, containing refs itself" ,
180
216
"schema" : {"$ref" : " http://json-schema.org/draft-04/schema#" },
Original file line number Diff line number Diff line change 175
175
}
176
176
]
177
177
},
178
+ {
179
+ "description" : " $ref prevents a sibling $id from changing the base uri" ,
180
+ "schema" : {
181
+ "$id" : " http://localhost:1234/sibling_id/base/" ,
182
+ "definitions" : {
183
+ "foo" : {
184
+ "$id" : " http://localhost:1234/sibling_id/foo.json" ,
185
+ "minimum" : 2
186
+ },
187
+ "base_foo" : {
188
+ "$comment" : " this canonical uri is http://localhost:1234/sibling_id/base/foo.json" ,
189
+ "$id" : " foo.json" ,
190
+ "minimum" : 5
191
+ }
192
+ },
193
+ "allOf" : [
194
+ {
195
+ "$comment" : " $ref resolves to http://localhost:1234/sibling_id/base/foo.json, not ttp://localhost:1234/sibling_id/foo.json" ,
196
+ "$id" : " http://localhost:1234/sibling_id/" ,
197
+ "$ref" : " foo.json"
198
+ }
199
+ ]
200
+ },
201
+ "tests" : [
202
+ {
203
+ "description" : " $ref resolves to /definitions/foo, data validates" ,
204
+ "data" : 10 ,
205
+ "valid" : true
206
+ },
207
+ {
208
+ "description" : " $ref resolves to /definitions/foo, data does not validate" ,
209
+ "data" : 1 ,
210
+ "valid" : false
211
+ }
212
+ ]
213
+ },
178
214
{
179
215
"description" : " remote ref, containing refs itself" ,
180
216
"schema" : {"$ref" : " http://json-schema.org/draft-06/schema#" },
Original file line number Diff line number Diff line change 175
175
}
176
176
]
177
177
},
178
+ {
179
+ "description" : " $ref prevents a sibling $id from changing the base uri" ,
180
+ "schema" : {
181
+ "$id" : " http://localhost:1234/sibling_id/base/" ,
182
+ "definitions" : {
183
+ "foo" : {
184
+ "$id" : " http://localhost:1234/sibling_id/foo.json" ,
185
+ "minimum" : 2
186
+ },
187
+ "base_foo" : {
188
+ "$comment" : " this canonical uri is http://localhost:1234/sibling_id/base/foo.json" ,
189
+ "$id" : " foo.json" ,
190
+ "minimum" : 5
191
+ }
192
+ },
193
+ "allOf" : [
194
+ {
195
+ "$comment" : " $ref resolves to http://localhost:1234/sibling_id/base/foo.json, not ttp://localhost:1234/sibling_id/foo.json" ,
196
+ "$id" : " http://localhost:1234/sibling_id/" ,
197
+ "$ref" : " foo.json"
198
+ }
199
+ ]
200
+ },
201
+ "tests" : [
202
+ {
203
+ "description" : " $ref resolves to /definitions/foo, data validates" ,
204
+ "data" : 10 ,
205
+ "valid" : true
206
+ },
207
+ {
208
+ "description" : " $ref resolves to /definitions/foo, data does not validate" ,
209
+ "data" : 1 ,
210
+ "valid" : false
211
+ }
212
+ ]
213
+ },
178
214
{
179
215
"description" : " remote ref, containing refs itself" ,
180
216
"schema" : {"$ref" : " http://json-schema.org/draft-07/schema#" },
You can’t perform that action at this time.
0 commit comments