File tree Expand file tree Collapse file tree 12 files changed +295
-1
lines changed Expand file tree Collapse file tree 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:
122122* [ networknt/json-schema-validator] ( https://github.com/networknt/json-schema-validator )
123123* [ Justify] ( https://github.com/leadpony/justify )
124124* [ Snow] ( https://github.com/ssilverman/snowy-json )
125+ * [ jsonschemafriend] ( https://github.com/jimblackler/jsonschemafriend )
125126
126127### JavaScript
127128
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ const jsonSchemaTest = require('json-schema-test');
66const refs = {
77 'http://localhost:1234/integer.json' : require ( './remotes/integer.json' ) ,
88 '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' ) ,
1012 'http://localhost:1234/name.json' : require ( './remotes/name.json' ) ,
1113 'http://localhost:1234/name-defs.json' : require ( './remotes/name-defs.json' )
1214} ;
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 407407 "valid" : false
408408 }
409409 ]
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+ ]
410433 }
411434]
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 215215 "valid" : false
216216 }
217217 ]
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+ ]
218241 }
219242]
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 434434 "valid" : false
435435 }
436436 ]
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+ ]
437460 }
438461]
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 466466 "valid" : false
467467 }
468468 ]
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+ ]
469492 }
470493]
You can’t perform that action at this time.
0 commit comments