File tree 12 files changed +295
-1
lines changed
12 files changed +295
-1
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ This suite is being used by:
122
122
* [ networknt/json-schema-validator] ( https://github.com/networknt/json-schema-validator )
123
123
* [ Justify] ( https://github.com/leadpony/justify )
124
124
* [ Snow] ( https://github.com/ssilverman/snowy-json )
125
+ * [ jsonschemafriend] ( https://github.com/jimblackler/jsonschemafriend )
125
126
126
127
### JavaScript
127
128
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ const jsonSchemaTest = require('json-schema-test');
6
6
const refs = {
7
7
'http://localhost:1234/integer.json' : require ( './remotes/integer.json' ) ,
8
8
'http://localhost:1234/subSchemas.json' : require ( './remotes/subSchemas.json' ) ,
9
- 'http://localhost:1234/folder/folderInteger.json' : require ( './remotes/folder/folderInteger.json' ) ,
9
+ 'http://localhost:1234/baseUriChange/folderInteger.json' : require ( './remotes/baseUriChange/folderInteger.json' ) ,
10
+ 'http://localhost:1234/baseUriChangeFolder/folderInteger.json' : require ( './remotes/baseUriChange/folderInteger.json' ) ,
11
+ 'http://localhost:1234/baseUriChangeFolderInSubschema/folderInteger.json' : require ( './remotes/baseUriChange/folderInteger.json' ) ,
10
12
'http://localhost:1234/name.json' : require ( './remotes/name.json' ) ,
11
13
'http://localhost:1234/name-defs.json' : require ( './remotes/name-defs.json' )
12
14
} ;
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "description" : " evaluating the same schema location against the same data location twice is not a sign of an infinite loop" ,
4
+ "schema" : {
5
+ "$defs" : {
6
+ "int" : { "type" : " integer" }
7
+ },
8
+ "allOf" : [
9
+ {
10
+ "properties" : {
11
+ "foo" : {
12
+ "$ref" : " #/$defs/int"
13
+ }
14
+ }
15
+ },
16
+ {
17
+ "additionalProperties" : {
18
+ "$ref" : " #/$defs/int"
19
+ }
20
+ }
21
+ ]
22
+ },
23
+ "tests" : [
24
+ {
25
+ "description" : " passing case" ,
26
+ "data" : { "foo" : 1 },
27
+ "valid" : true
28
+ },
29
+ {
30
+ "description" : " failing case" ,
31
+ "data" : { "foo" : " a string" },
32
+ "valid" : false
33
+ }
34
+ ]
35
+ }
36
+ ]
Original file line number Diff line number Diff line change 407
407
"valid" : false
408
408
}
409
409
]
410
+ },
411
+ {
412
+ "description" : " naive replacement of $ref with its destination is not correct" ,
413
+ "schema" : {
414
+ "$defs" : {
415
+ "a_string" : { "type" : " string" }
416
+ },
417
+ "enum" : [
418
+ { "$ref" : " #/$defs/a_string" }
419
+ ]
420
+ },
421
+ "tests" : [
422
+ {
423
+ "description" : " do not evaluate the $ref inside the enum" ,
424
+ "data" : " this is a string" ,
425
+ "valid" : false
426
+ },
427
+ {
428
+ "description" : " match the enum exactly" ,
429
+ "data" : { "$ref" : " #/$defs/a_string" },
430
+ "valid" : true
431
+ }
432
+ ]
410
433
}
411
434
]
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "description" : " evaluating the same schema location against the same data location twice is not a sign of an infinite loop" ,
4
+ "schema" : {
5
+ "definitions" : {
6
+ "int" : { "type" : " integer" }
7
+ },
8
+ "properties" : {
9
+ "foo" : {
10
+ "$ref" : " #/definitions/int"
11
+ }
12
+ },
13
+ "extends" : {
14
+ "additionalProperties" : {
15
+ "$ref" : " #/definitions/int"
16
+ }
17
+ }
18
+ },
19
+ "tests" : [
20
+ {
21
+ "description" : " passing case" ,
22
+ "data" : { "foo" : 1 },
23
+ "valid" : true
24
+ },
25
+ {
26
+ "description" : " failing case" ,
27
+ "data" : { "foo" : " a string" },
28
+ "valid" : false
29
+ }
30
+ ]
31
+ }
32
+ ]
Original file line number Diff line number Diff line change 215
215
"valid" : false
216
216
}
217
217
]
218
+ },
219
+ {
220
+ "description" : " naive replacement of $ref with its destination is not correct" ,
221
+ "schema" : {
222
+ "definitions" : {
223
+ "a_string" : { "type" : " string" }
224
+ },
225
+ "enum" : [
226
+ { "$ref" : " #/definitions/a_string" }
227
+ ]
228
+ },
229
+ "tests" : [
230
+ {
231
+ "description" : " do not evaluate the $ref inside the enum" ,
232
+ "data" : " this is a string" ,
233
+ "valid" : false
234
+ },
235
+ {
236
+ "description" : " match the enum exactly" ,
237
+ "data" : { "$ref" : " #/definitions/a_string" },
238
+ "valid" : true
239
+ }
240
+ ]
218
241
}
219
242
]
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "description" : " evaluating the same schema location against the same data location twice is not a sign of an infinite loop" ,
4
+ "schema" : {
5
+ "definitions" : {
6
+ "int" : { "type" : " integer" }
7
+ },
8
+ "allOf" : [
9
+ {
10
+ "properties" : {
11
+ "foo" : {
12
+ "$ref" : " #/definitions/int"
13
+ }
14
+ }
15
+ },
16
+ {
17
+ "additionalProperties" : {
18
+ "$ref" : " #/definitions/int"
19
+ }
20
+ }
21
+ ]
22
+ },
23
+ "tests" : [
24
+ {
25
+ "description" : " passing case" ,
26
+ "data" : { "foo" : 1 },
27
+ "valid" : true
28
+ },
29
+ {
30
+ "description" : " failing case" ,
31
+ "data" : { "foo" : " a string" },
32
+ "valid" : false
33
+ }
34
+ ]
35
+ }
36
+ ]
Original file line number Diff line number Diff line change 434
434
"valid" : false
435
435
}
436
436
]
437
+ },
438
+ {
439
+ "description" : " naive replacement of $ref with its destination is not correct" ,
440
+ "schema" : {
441
+ "definitions" : {
442
+ "a_string" : { "type" : " string" }
443
+ },
444
+ "enum" : [
445
+ { "$ref" : " #/definitions/a_string" }
446
+ ]
447
+ },
448
+ "tests" : [
449
+ {
450
+ "description" : " do not evaluate the $ref inside the enum" ,
451
+ "data" : " this is a string" ,
452
+ "valid" : false
453
+ },
454
+ {
455
+ "description" : " match the enum exactly" ,
456
+ "data" : { "$ref" : " #/definitions/a_string" },
457
+ "valid" : true
458
+ }
459
+ ]
437
460
}
438
461
]
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "description" : " evaluating the same schema location against the same data location twice is not a sign of an infinite loop" ,
4
+ "schema" : {
5
+ "definitions" : {
6
+ "int" : { "type" : " integer" }
7
+ },
8
+ "allOf" : [
9
+ {
10
+ "properties" : {
11
+ "foo" : {
12
+ "$ref" : " #/definitions/int"
13
+ }
14
+ }
15
+ },
16
+ {
17
+ "additionalProperties" : {
18
+ "$ref" : " #/definitions/int"
19
+ }
20
+ }
21
+ ]
22
+ },
23
+ "tests" : [
24
+ {
25
+ "description" : " passing case" ,
26
+ "data" : { "foo" : 1 },
27
+ "valid" : true
28
+ },
29
+ {
30
+ "description" : " failing case" ,
31
+ "data" : { "foo" : " a string" },
32
+ "valid" : false
33
+ }
34
+ ]
35
+ }
36
+ ]
Original file line number Diff line number Diff line change 466
466
"valid" : false
467
467
}
468
468
]
469
+ },
470
+ {
471
+ "description" : " naive replacement of $ref with its destination is not correct" ,
472
+ "schema" : {
473
+ "definitions" : {
474
+ "a_string" : { "type" : " string" }
475
+ },
476
+ "enum" : [
477
+ { "$ref" : " #/definitions/a_string" }
478
+ ]
479
+ },
480
+ "tests" : [
481
+ {
482
+ "description" : " do not evaluate the $ref inside the enum" ,
483
+ "data" : " this is a string" ,
484
+ "valid" : false
485
+ },
486
+ {
487
+ "description" : " match the enum exactly" ,
488
+ "data" : { "$ref" : " #/definitions/a_string" },
489
+ "valid" : true
490
+ }
491
+ ]
469
492
}
470
493
]
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "description" : " evaluating the same schema location against the same data location twice is not a sign of an infinite loop" ,
4
+ "schema" : {
5
+ "definitions" : {
6
+ "int" : { "type" : " integer" }
7
+ },
8
+ "allOf" : [
9
+ {
10
+ "properties" : {
11
+ "foo" : {
12
+ "$ref" : " #/definitions/int"
13
+ }
14
+ }
15
+ },
16
+ {
17
+ "additionalProperties" : {
18
+ "$ref" : " #/definitions/int"
19
+ }
20
+ }
21
+ ]
22
+ },
23
+ "tests" : [
24
+ {
25
+ "description" : " passing case" ,
26
+ "data" : { "foo" : 1 },
27
+ "valid" : true
28
+ },
29
+ {
30
+ "description" : " failing case" ,
31
+ "data" : { "foo" : " a string" },
32
+ "valid" : false
33
+ }
34
+ ]
35
+ }
36
+ ]
Original file line number Diff line number Diff line change 466
466
"valid" : false
467
467
}
468
468
]
469
+ },
470
+ {
471
+ "description" : " naive replacement of $ref with its destination is not correct" ,
472
+ "schema" : {
473
+ "definitions" : {
474
+ "a_string" : { "type" : " string" }
475
+ },
476
+ "enum" : [
477
+ { "$ref" : " #/definitions/a_string" }
478
+ ]
479
+ },
480
+ "tests" : [
481
+ {
482
+ "description" : " do not evaluate the $ref inside the enum" ,
483
+ "data" : " this is a string" ,
484
+ "valid" : false
485
+ },
486
+ {
487
+ "description" : " match the enum exactly" ,
488
+ "data" : { "$ref" : " #/definitions/a_string" },
489
+ "valid" : true
490
+ }
491
+ ]
469
492
}
470
493
]
You can’t perform that action at this time.
0 commit comments