File tree 8 files changed +262
-4
lines changed
8 files changed +262
-4
lines changed Original file line number Diff line number Diff line change 169
169
"valid" : false
170
170
}
171
171
]
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
+ ]
172
203
}
173
204
]
Original file line number Diff line number Diff line change 254
254
"valid" : false
255
255
}
256
256
]
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
+ ]
257
288
}
258
289
]
Original file line number Diff line number Diff line change 577
577
"valid" : false
578
578
}
579
579
]
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
+ ]
580
645
}
581
646
]
Original file line number Diff line number Diff line change 1
1
[
2
2
{
3
3
"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
+ },
5
7
"tests" : [
6
8
{
7
9
"description" : " Identifier name" ,
Original file line number Diff line number Diff line change 177
177
},
178
178
{
179
179
"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
+ },
181
183
"tests" : [
182
184
{
183
185
"description" : " remote ref valid" ,
298
300
"tests" : [
299
301
{
300
302
"description" : " valid tree" ,
301
- "data" : {
303
+ "data" : {
302
304
"meta" : " root" ,
303
305
"nodes" : [
304
306
{
327
329
},
328
330
{
329
331
"description" : " invalid tree" ,
330
- "data" : {
332
+ "data" : {
331
333
"meta" : " root" ,
332
334
"nodes" : [
333
335
{
Original file line number Diff line number Diff line change 169
169
"valid" : false
170
170
}
171
171
]
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
+ ]
172
203
}
173
204
]
Original file line number Diff line number Diff line change 254
254
"valid" : false
255
255
}
256
256
]
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
+ ]
257
288
}
258
289
]
Original file line number Diff line number Diff line change 577
577
"valid" : false
578
578
}
579
579
]
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
+ ]
580
645
}
581
646
]
You can’t perform that action at this time.
0 commit comments