File tree Expand file tree Collapse file tree 19 files changed +709
-0
lines changed Expand file tree Collapse file tree 19 files changed +709
-0
lines changed Original file line number Diff line number Diff line change 38
38
"valid" : false
39
39
}
40
40
]
41
+ },
42
+ {
43
+ "description" : " minimum validation with signed integer" ,
44
+ "schema" : {"minimum" : -2 },
45
+ "tests" : [
46
+ {
47
+ "description" : " negative above the minimum is valid" ,
48
+ "data" : -1 ,
49
+ "valid" : true
50
+ },
51
+ {
52
+ "description" : " positive above the minimum is valid" ,
53
+ "data" : 0 ,
54
+ "valid" : true
55
+ },
56
+ {
57
+ "description" : " boundary point is valid" ,
58
+ "data" : -2 ,
59
+ "valid" : true
60
+ },
61
+ {
62
+ "description" : " below the minimum is invalid" ,
63
+ "data" : -3 ,
64
+ "valid" : false
65
+ },
66
+ {
67
+ "description" : " ignores non-numbers" ,
68
+ "data" : " x" ,
69
+ "valid" : true
70
+ }
71
+ ]
41
72
}
42
73
]
Original file line number Diff line number Diff line change 119
119
"valid" : false
120
120
}
121
121
]
122
+ },
123
+ {
124
+ "description" : " dependencies with escaped characters" ,
125
+ "schema" : {
126
+ "dependencies" : {
127
+ "foo\n bar" : [" foo\r bar" ],
128
+ "foo\t bar" : {
129
+ "minProperties" : 4
130
+ },
131
+ "foo'bar" : {"required" : [" foo\" bar" ]},
132
+ "foo\" bar" : [" foo'bar" ]
133
+ }
134
+ },
135
+ "tests" : [
136
+ {
137
+ "description" : " valid object 1" ,
138
+ "data" : {
139
+ "foo\n bar" : 1 ,
140
+ "foo\r bar" : 2
141
+ },
142
+ "valid" : true
143
+ },
144
+ {
145
+ "description" : " valid object 2" ,
146
+ "data" : {
147
+ "foo\t bar" : 1 ,
148
+ "a" : 2 ,
149
+ "b" : 3 ,
150
+ "c" : 4
151
+ },
152
+ "valid" : true
153
+ },
154
+ {
155
+ "description" : " valid object 3" ,
156
+ "data" : {
157
+ "foo'bar" : 1 ,
158
+ "foo\" bar" : 2
159
+ },
160
+ "valid" : true
161
+ },
162
+ {
163
+ "description" : " invalid object 1" ,
164
+ "data" : {
165
+ "foo\n bar" : 1 ,
166
+ "foo" : 2
167
+ },
168
+ "valid" : false
169
+ },
170
+ {
171
+ "description" : " invalid object 2" ,
172
+ "data" : {
173
+ "foo\t bar" : 1 ,
174
+ "a" : 2
175
+ },
176
+ "valid" : false
177
+ },
178
+ {
179
+ "description" : " invalid object 3" ,
180
+ "data" : {
181
+ "foo'bar" : 1
182
+ },
183
+ "valid" : false
184
+ },
185
+ {
186
+ "description" : " invalid object 4" ,
187
+ "data" : {
188
+ "foo\" bar" : 2
189
+ },
190
+ "valid" : false
191
+ }
192
+ ]
122
193
}
123
194
]
Original file line number Diff line number Diff line change 68
68
"valid" : false
69
69
}
70
70
]
71
+ },
72
+ {
73
+ "description" : " enum with escaped characters" ,
74
+ "schema" : {
75
+ "enum" : [" foo\n bar" , " foo\r bar" ]
76
+ },
77
+ "tests" : [
78
+ {
79
+ "description" : " member 1 is valid" ,
80
+ "data" : " foo\n bar" ,
81
+ "valid" : true
82
+ },
83
+ {
84
+ "description" : " member 2 is valid" ,
85
+ "data" : " foo\r bar" ,
86
+ "valid" : true
87
+ },
88
+ {
89
+ "description" : " another string is invalid" ,
90
+ "data" : " abc" ,
91
+ "valid" : false
92
+ }
93
+ ]
71
94
}
72
95
]
Original file line number Diff line number Diff line change 69
69
"valid" : false
70
70
}
71
71
]
72
+ },
73
+ {
74
+ "description" : " minimum validation with signed integer" ,
75
+ "schema" : {"minimum" : -2 },
76
+ "tests" : [
77
+ {
78
+ "description" : " negative above the minimum is valid" ,
79
+ "data" : -1 ,
80
+ "valid" : true
81
+ },
82
+ {
83
+ "description" : " positive above the minimum is valid" ,
84
+ "data" : 0 ,
85
+ "valid" : true
86
+ },
87
+ {
88
+ "description" : " boundary point is valid" ,
89
+ "data" : -2 ,
90
+ "valid" : true
91
+ },
92
+ {
93
+ "description" : " below the minimum is invalid" ,
94
+ "data" : -3 ,
95
+ "valid" : false
96
+ },
97
+ {
98
+ "description" : " ignores non-numbers" ,
99
+ "data" : " x" ,
100
+ "valid" : true
101
+ }
102
+ ]
72
103
}
73
104
]
Original file line number Diff line number Diff line change 93
93
"valid" : false
94
94
}
95
95
]
96
+ },
97
+ {
98
+ "description" : " properties with escaped characters" ,
99
+ "schema" : {
100
+ "properties" : {
101
+ "foo\n bar" : {"type" : " number" },
102
+ "foo\" bar" : {"type" : " number" },
103
+ "foo\\ bar" : {"type" : " number" },
104
+ "foo\r bar" : {"type" : " number" },
105
+ "foo\t bar" : {"type" : " number" },
106
+ "foo\f bar" : {"type" : " number" }
107
+ }
108
+ },
109
+ "tests" : [
110
+ {
111
+ "description" : " object with all numbers is valid" ,
112
+ "data" : {
113
+ "foo\n bar" : 1 ,
114
+ "foo\" bar" : 1 ,
115
+ "foo\\ bar" : 1 ,
116
+ "foo\r bar" : 1 ,
117
+ "foo\t bar" : 1 ,
118
+ "foo\f bar" : 1
119
+ },
120
+ "valid" : true
121
+ },
122
+ {
123
+ "description" : " object with strings is invalid" ,
124
+ "data" : {
125
+ "foo\n bar" : " 1" ,
126
+ "foo\" bar" : " 1" ,
127
+ "foo\\ bar" : " 1" ,
128
+ "foo\r bar" : " 1" ,
129
+ "foo\t bar" : " 1" ,
130
+ "foo\f bar" : " 1"
131
+ },
132
+ "valid" : false
133
+ }
134
+ ]
96
135
}
97
136
]
Original file line number Diff line number Diff line change 296
296
"valid" : false
297
297
}
298
298
]
299
+ },
300
+ {
301
+ "description" : " refs with quote" ,
302
+ "schema" : {
303
+ "properties" : {
304
+ "foo\" bar" : {"$ref" : " #/definitions/foo\" bar" }
305
+ },
306
+ "definitions" : {
307
+ "foo\" bar" : {"type" : " number" }
308
+ }
309
+ },
310
+ "tests" : [
311
+ {
312
+ "description" : " object with numbers is valid" ,
313
+ "data" : {
314
+ "foo\" bar" : 1
315
+ },
316
+ "valid" : true
317
+ },
318
+ {
319
+ "description" : " object with strings is invalid" ,
320
+ "data" : {
321
+ "foo\" bar" : " 1"
322
+ },
323
+ "valid" : false
324
+ }
325
+ ]
299
326
}
300
327
]
Original file line number Diff line number Diff line change 50
50
"valid" : true
51
51
}
52
52
]
53
+ },
54
+ {
55
+ "description" : " required with escaped characters" ,
56
+ "schema" : {
57
+ "required" : [
58
+ " foo\n bar" ,
59
+ " foo\" bar" ,
60
+ " foo\\ bar" ,
61
+ " foo\r bar" ,
62
+ " foo\t bar" ,
63
+ " foo\f bar"
64
+ ]
65
+ },
66
+ "tests" : [
67
+ {
68
+ "description" : " object with all properties present is valid" ,
69
+ "data" : {
70
+ "foo\n bar" : 1 ,
71
+ "foo\" bar" : 1 ,
72
+ "foo\\ bar" : 1 ,
73
+ "foo\r bar" : 1 ,
74
+ "foo\t bar" : 1 ,
75
+ "foo\f bar" : 1
76
+ },
77
+ "valid" : true
78
+ },
79
+ {
80
+ "description" : " object with some properties missing is invalid" ,
81
+ "data" : {
82
+ "foo\n bar" : " 1" ,
83
+ "foo\" bar" : " 1"
84
+ },
85
+ "valid" : false
86
+ }
87
+ ]
53
88
}
54
89
]
Original file line number Diff line number Diff line change 193
193
"valid" : true
194
194
}
195
195
]
196
+ },
197
+ {
198
+ "description" : " dependencies with escaped characters" ,
199
+ "schema" : {
200
+ "dependencies" : {
201
+ "foo\n bar" : [" foo\r bar" ],
202
+ "foo\t bar" : {
203
+ "minProperties" : 4
204
+ },
205
+ "foo'bar" : {"required" : [" foo\" bar" ]},
206
+ "foo\" bar" : [" foo'bar" ]
207
+ }
208
+ },
209
+ "tests" : [
210
+ {
211
+ "description" : " valid object 1" ,
212
+ "data" : {
213
+ "foo\n bar" : 1 ,
214
+ "foo\r bar" : 2
215
+ },
216
+ "valid" : true
217
+ },
218
+ {
219
+ "description" : " valid object 2" ,
220
+ "data" : {
221
+ "foo\t bar" : 1 ,
222
+ "a" : 2 ,
223
+ "b" : 3 ,
224
+ "c" : 4
225
+ },
226
+ "valid" : true
227
+ },
228
+ {
229
+ "description" : " valid object 3" ,
230
+ "data" : {
231
+ "foo'bar" : 1 ,
232
+ "foo\" bar" : 2
233
+ },
234
+ "valid" : true
235
+ },
236
+ {
237
+ "description" : " invalid object 1" ,
238
+ "data" : {
239
+ "foo\n bar" : 1 ,
240
+ "foo" : 2
241
+ },
242
+ "valid" : false
243
+ },
244
+ {
245
+ "description" : " invalid object 2" ,
246
+ "data" : {
247
+ "foo\t bar" : 1 ,
248
+ "a" : 2
249
+ },
250
+ "valid" : false
251
+ },
252
+ {
253
+ "description" : " invalid object 3" ,
254
+ "data" : {
255
+ "foo'bar" : 1
256
+ },
257
+ "valid" : false
258
+ },
259
+ {
260
+ "description" : " invalid object 4" ,
261
+ "data" : {
262
+ "foo\" bar" : 2
263
+ },
264
+ "valid" : false
265
+ }
266
+ ]
196
267
}
197
268
]
You can’t perform that action at this time.
0 commit comments