File tree Expand file tree Collapse file tree 8 files changed +262
-4
lines changed Expand file tree Collapse file tree 8 files changed +262
-4
lines changed Original file line number Diff line number Diff line change 169169 "valid" : false
170170 }
171171 ]
172+ },
173+ {
174+ "description" : " non-schema object containing an $anchor property" ,
175+ "schema" : {
176+ "$defs" : {
177+ "const_not_anchor" : {
178+ "const" : {
179+ "$anchor" : " not_a_real_anchor"
180+ }
181+ }
182+ },
183+ "if" : {
184+ "const" : " skip not_a_real_anchor"
185+ },
186+ "then" : true ,
187+ "else" : {
188+ "$ref" : " #/$defs/const_not_anchor"
189+ }
190+ },
191+ "tests" : [
192+ {
193+ "description" : " skip traversing definition for a valid result" ,
194+ "data" : " skip not_a_real_anchor" ,
195+ "valid" : true
196+ },
197+ {
198+ "description" : " const at const_not_anchor does not match" ,
199+ "data" : 1 ,
200+ "valid" : false
201+ }
202+ ]
172203 }
173204]
Original file line number Diff line number Diff line change 254254 "valid" : false
255255 }
256256 ]
257+ },
258+ {
259+ "description" : " non-schema object containing an $id property" ,
260+ "schema" : {
261+ "$defs" : {
262+ "const_not_id" : {
263+ "const" : {
264+ "$id" : " not_a_real_id"
265+ }
266+ }
267+ },
268+ "if" : {
269+ "const" : " skip not_a_real_id"
270+ },
271+ "then" : true ,
272+ "else" : {
273+ "$ref" : " #/$defs/const_not_id"
274+ }
275+ },
276+ "tests" : [
277+ {
278+ "description" : " skip traversing definition for a valid result" ,
279+ "data" : " skip not_a_real_id" ,
280+ "valid" : true
281+ },
282+ {
283+ "description" : " const at const_not_id does not match" ,
284+ "data" : 1 ,
285+ "valid" : false
286+ }
287+ ]
257288 }
258289]
Original file line number Diff line number Diff line change 577577 "valid" : false
578578 }
579579 ]
580+ },
581+ {
582+ "description" : " order of evaluation: $id and $ref" ,
583+ "schema" : {
584+ "$comment" : " $id must be evaluated before $ref to get the proper $ref destination" ,
585+ "$id" : " /ref-and-id1/base.json" ,
586+ "$ref" : " int.json" ,
587+ "$defs" : {
588+ "bigint" : {
589+ "$comment" : " canonical uri: /ref-and-id1/int.json" ,
590+ "$id" : " int.json" ,
591+ "maximum" : 10
592+ },
593+ "smallint" : {
594+ "$comment" : " canonical uri: /ref-and-id1-int.json" ,
595+ "$id" : " /ref-and-id1-int.json" ,
596+ "maximum" : 2
597+ }
598+ }
599+ },
600+ "tests" : [
601+ {
602+ "description" : " data is valid against first definition" ,
603+ "data" : 5 ,
604+ "valid" : true
605+ },
606+ {
607+ "description" : " data is invalid against first definition" ,
608+ "data" : 50 ,
609+ "valid" : false
610+ }
611+ ]
612+ },
613+ {
614+ "description" : " order of evaluation: $id and $anchor and $ref" ,
615+ "schema" : {
616+ "$comment" : " $id must be evaluated before $ref to get the proper $ref destination" ,
617+ "$id" : " /ref-and-id2/base.json" ,
618+ "$ref" : " #bigint" ,
619+ "$defs" : {
620+ "bigint" : {
621+ "$comment" : " canonical uri: /ref-and-id2/base.json/$defs/bigint; another valid uri for this location: /ref-and-id2/base.json#bigint" ,
622+ "$anchor" : " bigint" ,
623+ "maximum" : 10
624+ },
625+ "smallint" : {
626+ "$comment" : " canonical uri: /ref-and-id2#/$defs/smallint; another valid uri for this location: /ref-and-id2/#bigint" ,
627+ "$id" : " /ref-and-id2/" ,
628+ "$anchor" : " bigint" ,
629+ "maximum" : 2
630+ }
631+ }
632+ },
633+ "tests" : [
634+ {
635+ "description" : " data is valid against first definition" ,
636+ "data" : 5 ,
637+ "valid" : true
638+ },
639+ {
640+ "description" : " data is invalid against first definition" ,
641+ "data" : 50 ,
642+ "valid" : false
643+ }
644+ ]
580645 }
581646]
Original file line number Diff line number Diff line change 11[
22 {
33 "description" : " Invalid use of fragments in location-independent $id" ,
4- "schema" : {"$ref" : " https://json-schema.org/draft/2019-09/schema" },
4+ "schema" : {
5+ "$ref" : " https://json-schema.org/draft/2019-09/schema"
6+ },
57 "tests" : [
68 {
79 "description" : " Identifier name" ,
Original file line number Diff line number Diff line change 177177 },
178178 {
179179 "description" : " remote ref, containing refs itself" ,
180- "schema" : {"$ref" : " https://json-schema.org/draft/2019-09/schema" },
180+ "schema" : {
181+ "$ref" : " https://json-schema.org/draft/2019-09/schema"
182+ },
181183 "tests" : [
182184 {
183185 "description" : " remote ref valid" ,
298300 "tests" : [
299301 {
300302 "description" : " valid tree" ,
301- "data" : {
303+ "data" : {
302304 "meta" : " root" ,
303305 "nodes" : [
304306 {
327329 },
328330 {
329331 "description" : " invalid tree" ,
330- "data" : {
332+ "data" : {
331333 "meta" : " root" ,
332334 "nodes" : [
333335 {
Original file line number Diff line number Diff line change 169169 "valid" : false
170170 }
171171 ]
172+ },
173+ {
174+ "description" : " non-schema object containing an $anchor property" ,
175+ "schema" : {
176+ "$defs" : {
177+ "const_not_anchor" : {
178+ "const" : {
179+ "$anchor" : " not_a_real_anchor"
180+ }
181+ }
182+ },
183+ "if" : {
184+ "const" : " skip not_a_real_anchor"
185+ },
186+ "then" : true ,
187+ "else" : {
188+ "$ref" : " #/$defs/const_not_anchor"
189+ }
190+ },
191+ "tests" : [
192+ {
193+ "description" : " skip traversing definition for a valid result" ,
194+ "data" : " skip not_a_real_anchor" ,
195+ "valid" : true
196+ },
197+ {
198+ "description" : " const at const_not_anchor does not match" ,
199+ "data" : 1 ,
200+ "valid" : false
201+ }
202+ ]
172203 }
173204]
Original file line number Diff line number Diff line change 254254 "valid" : false
255255 }
256256 ]
257+ },
258+ {
259+ "description" : " non-schema object containing an $id property" ,
260+ "schema" : {
261+ "$defs" : {
262+ "const_not_id" : {
263+ "const" : {
264+ "$id" : " not_a_real_id"
265+ }
266+ }
267+ },
268+ "if" : {
269+ "const" : " skip not_a_real_id"
270+ },
271+ "then" : true ,
272+ "else" : {
273+ "$ref" : " #/$defs/const_not_id"
274+ }
275+ },
276+ "tests" : [
277+ {
278+ "description" : " skip traversing definition for a valid result" ,
279+ "data" : " skip not_a_real_id" ,
280+ "valid" : true
281+ },
282+ {
283+ "description" : " const at const_not_id does not match" ,
284+ "data" : 1 ,
285+ "valid" : false
286+ }
287+ ]
257288 }
258289]
Original file line number Diff line number Diff line change 577577 "valid" : false
578578 }
579579 ]
580+ },
581+ {
582+ "description" : " order of evaluation: $id and $ref" ,
583+ "schema" : {
584+ "$comment" : " $id must be evaluated before $ref to get the proper $ref destination" ,
585+ "$id" : " /ref-and-id1/base.json" ,
586+ "$ref" : " int.json" ,
587+ "$defs" : {
588+ "bigint" : {
589+ "$comment" : " canonical uri: /ref-and-id1/int.json" ,
590+ "$id" : " int.json" ,
591+ "maximum" : 10
592+ },
593+ "smallint" : {
594+ "$comment" : " canonical uri: /ref-and-id1-int.json" ,
595+ "$id" : " /ref-and-id1-int.json" ,
596+ "maximum" : 2
597+ }
598+ }
599+ },
600+ "tests" : [
601+ {
602+ "description" : " data is valid against first definition" ,
603+ "data" : 5 ,
604+ "valid" : true
605+ },
606+ {
607+ "description" : " data is invalid against first definition" ,
608+ "data" : 50 ,
609+ "valid" : false
610+ }
611+ ]
612+ },
613+ {
614+ "description" : " order of evaluation: $id and $anchor and $ref" ,
615+ "schema" : {
616+ "$comment" : " $id must be evaluated before $ref to get the proper $ref destination" ,
617+ "$id" : " /ref-and-id2/base.json" ,
618+ "$ref" : " #bigint" ,
619+ "$defs" : {
620+ "bigint" : {
621+ "$comment" : " canonical uri: /ref-and-id2/base.json/$defs/bigint; another valid uri for this location: /ref-and-id2/base.json#bigint" ,
622+ "$anchor" : " bigint" ,
623+ "maximum" : 10
624+ },
625+ "smallint" : {
626+ "$comment" : " canonical uri: /ref-and-id2#/$defs/smallint; another valid uri for this location: /ref-and-id2/#bigint" ,
627+ "$id" : " /ref-and-id2/" ,
628+ "$anchor" : " bigint" ,
629+ "maximum" : 2
630+ }
631+ }
632+ },
633+ "tests" : [
634+ {
635+ "description" : " data is valid against first definition" ,
636+ "data" : 5 ,
637+ "valid" : true
638+ },
639+ {
640+ "description" : " data is invalid against first definition" ,
641+ "data" : 50 ,
642+ "valid" : false
643+ }
644+ ]
580645 }
581646]
You can’t perform that action at this time.
0 commit comments