File tree 5 files changed +102
-0
lines changed
5 files changed +102
-0
lines changed Original file line number Diff line number Diff line change @@ -67,10 +67,14 @@ This suite is being used by:
67
67
* [ jsonschema (javascript)] ( https://github.com/tdegrunt/jsonschema )
68
68
* [ JaySchema (javascript)] ( https://github.com/natesilva/jayschema )
69
69
* [ z-schema (javascript)] ( https://github.com/zaggino/z-schema )
70
+ * [ jassi (javascript)] ( https://github.com/iclanzan/jassi )
71
+ * [ json-schema-valid (javascript)] ( https://github.com/ericgj/json-schema-valid )
70
72
* [ jesse (Erlang)] ( https://github.com/klarna/jesse )
71
73
* [ json-schema (PHP)] ( https://github.com/justinrainbow/json-schema )
72
74
* [ gojsonschema (Go)] ( https://github.com/sigu-399/gojsonschema )
73
75
* [ json_schema (Dart)] ( https://github.com/patefacio/json_schema )
76
+ * [ tv4 (JavaScript)] ( https://github.com/geraintluff/tv4 )
77
+ * [ Jsonary (JavaScript)] ( https://github.com/jsonary-js/jsonary )
74
78
75
79
If you use it as well, please fork and send a pull request adding yourself to
76
80
the list :).
Original file line number Diff line number Diff line change 35
35
"valid" : false
36
36
}
37
37
]
38
+ },
39
+ {
40
+ "description" : " enums in properties" ,
41
+ "schema" : {
42
+ "type" :" object" ,
43
+ "properties" : {
44
+ "foo" : {"enum" :[" foo" ]},
45
+ "bar" : {"enum" :[" bar" ], "required" :true }
46
+ }
47
+ },
48
+ "tests" : [
49
+ {
50
+ "description" : " both properties are valid" ,
51
+ "data" : {"foo" :" foo" , "bar" :" bar" },
52
+ "valid" : true
53
+ },
54
+ {
55
+ "description" : " missing optional property is valid" ,
56
+ "data" : {"bar" :" bar" },
57
+ "valid" : true
58
+ },
59
+ {
60
+ "description" : " missing required property is invalid" ,
61
+ "data" : {"foo" :" foo" },
62
+ "valid" : false
63
+ },
64
+ {
65
+ "description" : " missing all properties is invalid" ,
66
+ "data" : {},
67
+ "valid" : false
68
+ }
69
+ ]
38
70
}
39
71
]
Original file line number Diff line number Diff line change 35
35
"valid" : false
36
36
}
37
37
]
38
+ },
39
+ {
40
+ "description" : " enums in properties" ,
41
+ "schema" : {
42
+ "type" :" object" ,
43
+ "properties" : {
44
+ "foo" : {"enum" :[" foo" ]},
45
+ "bar" : {"enum" :[" bar" ]}
46
+ },
47
+ "required" : [" bar" ]
48
+ },
49
+ "tests" : [
50
+ {
51
+ "description" : " both properties are valid" ,
52
+ "data" : {"foo" :" foo" , "bar" :" bar" },
53
+ "valid" : true
54
+ },
55
+ {
56
+ "description" : " missing optional property is valid" ,
57
+ "data" : {"bar" :" bar" },
58
+ "valid" : true
59
+ },
60
+ {
61
+ "description" : " missing required property is invalid" ,
62
+ "data" : {"foo" :" foo" },
63
+ "valid" : false
64
+ },
65
+ {
66
+ "description" : " missing all properties is invalid" ,
67
+ "data" : {},
68
+ "valid" : false
69
+ }
70
+ ]
38
71
}
39
72
]
Original file line number Diff line number Diff line change 69
69
"valid" : false
70
70
}
71
71
]
72
+ },
73
+ {
74
+ "description" : " forbidden property" ,
75
+ "schema" : {
76
+ "properties" : {
77
+ "foo" : {
78
+ "not" : {}
79
+ }
80
+ }
81
+ },
82
+ "tests" : [
83
+ {
84
+ "description" : " property present" ,
85
+ "data" : {"foo" : 1 , "bar" : 2 },
86
+ "valid" : false
87
+ },
88
+ {
89
+ "description" : " property absent" ,
90
+ "data" : {"bar" : 1 , "baz" : 2 },
91
+ "valid" : true
92
+ }
93
+ ]
72
94
}
95
+
73
96
]
Original file line number Diff line number Diff line change 75
75
"description" : " an IP address with out-of-range values" ,
76
76
"data" : " 256.256.256.256" ,
77
77
"valid" : false
78
+ },
79
+ {
80
+ "description" : " an IP address without 4 components" ,
81
+ "data" : " 127.0" ,
82
+ "valid" : false
83
+ },
84
+ {
85
+ "description" : " an IP address as an integer" ,
86
+ "data" : " 0x7f000001" ,
87
+ "valid" : false
78
88
}
79
89
]
80
90
},
You can’t perform that action at this time.
0 commit comments