File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 200200 }
201201 ]
202202 },
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+ },
203239 {
204240 "description" : " remote ref, containing refs itself" ,
205241 "schema" : {"$ref" : " http://json-schema.org/draft-03/schema#" },
Original file line number Diff line number Diff line change 175175 }
176176 ]
177177 },
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+ },
178214 {
179215 "description" : " remote ref, containing refs itself" ,
180216 "schema" : {"$ref" : " http://json-schema.org/draft-04/schema#" },
Original file line number Diff line number Diff line change 175175 }
176176 ]
177177 },
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+ },
178214 {
179215 "description" : " remote ref, containing refs itself" ,
180216 "schema" : {"$ref" : " http://json-schema.org/draft-06/schema#" },
Original file line number Diff line number Diff line change 172172 "description" : " remote ref with ref to definitions" ,
173173 "schema" : {
174174 "$id" : " http://localhost:1234/schema-remote-ref-ref-defs1.json" ,
175- "$ref" : " ref-and-definitions.json"
175+ "allOf" : [
176+ { "$ref" : " ref-and-definitions.json" }
177+ ]
176178 },
177179 "tests" : [
178180 {
Original file line number Diff line number Diff line change 175175 }
176176 ]
177177 },
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+ },
178214 {
179215 "description" : " remote ref, containing refs itself" ,
180216 "schema" : {"$ref" : " http://json-schema.org/draft-07/schema#" },
Original file line number Diff line number Diff line change 172172 "description" : " remote ref with ref to definitions" ,
173173 "schema" : {
174174 "$id" : " http://localhost:1234/schema-remote-ref-ref-defs1.json" ,
175- "$ref" : " ref-and-definitions.json"
175+ "allOf" : [
176+ { "$ref" : " ref-and-definitions.json" }
177+ ]
176178 },
177179 "tests" : [
178180 {
You can’t perform that action at this time.
0 commit comments