kwalify 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +14 -3
- data/README.txt +3 -3
- data/bin/kwalify +4 -15
- data/doc/users-guide.html +237 -61
- data/examples/address-book/address-book.schema.yaml +1 -1
- data/examples/invoice/invoice.schema.yaml +2 -2
- data/examples/tapkit/tapkit.schema.yaml +39 -39
- data/lib/kwalify.rb +4 -4
- data/lib/kwalify/errors.rb +21 -14
- data/lib/kwalify/main.rb +357 -0
- data/lib/kwalify/messages.rb +38 -9
- data/lib/kwalify/meta-validator.rb +96 -64
- data/lib/kwalify/rule.rb +356 -269
- data/lib/kwalify/types.rb +53 -35
- data/lib/kwalify/util/assert-diff.rb +2 -2
- data/lib/kwalify/util/option-parser.rb +2 -2
- data/lib/kwalify/util/yaml-helper.rb +2 -2
- data/lib/kwalify/validator.rb +8 -17
- data/lib/kwalify/{parser.rb → yaml-parser.rb} +70 -41
- data/test/test-main.rb +179 -0
- data/test/test-main.yaml +756 -0
- data/test/test-metavalidator.rb +38 -721
- data/test/test-metavalidator.yaml +1104 -0
- data/test/test-rule.rb +60 -0
- data/test/test-rule.yaml +314 -0
- data/test/test-validator.rb +5 -5
- data/test/test-validator.yaml +816 -0
- data/test/{test-parser.rb → test-yamlparser.rb} +17 -17
- data/test/test-yamlparser.yaml +1080 -0
- data/test/test.rb +5 -3
- data/todo.txt +1 -0
- metadata +16 -11
- data/lib/kwalify/main-program.rb +0 -258
@@ -0,0 +1,1104 @@
|
|
1
|
+
##
|
2
|
+
## $Rev: 42 $
|
3
|
+
## $Release: 0.5.0 $
|
4
|
+
## copyright(c) 2005 kuwata-lab all rights reserved.
|
5
|
+
##
|
6
|
+
---
|
7
|
+
name: schema_notmap
|
8
|
+
desc: schema_notmap
|
9
|
+
#
|
10
|
+
schema: |
|
11
|
+
- type: str
|
12
|
+
- type: int
|
13
|
+
#
|
14
|
+
meta-msg: |
|
15
|
+
:type_unmatch : [/] not a mapping.
|
16
|
+
#
|
17
|
+
rule-msg: |
|
18
|
+
:schema_notmap : [/] schema definition is not a mapping.
|
19
|
+
# :invalid_schema : [/] schema definition is invalid.
|
20
|
+
#
|
21
|
+
---
|
22
|
+
name: type_unknown1
|
23
|
+
desc: unkown type
|
24
|
+
#
|
25
|
+
schema: |
|
26
|
+
type: map
|
27
|
+
mapping:
|
28
|
+
"name1":
|
29
|
+
type: str
|
30
|
+
"name2":
|
31
|
+
type: string
|
32
|
+
"age1":
|
33
|
+
type: int
|
34
|
+
"age2":
|
35
|
+
type: integer
|
36
|
+
"desc1":
|
37
|
+
type: text
|
38
|
+
"amount1":
|
39
|
+
type: float
|
40
|
+
"amount2":
|
41
|
+
type: number
|
42
|
+
"birth1":
|
43
|
+
type: date
|
44
|
+
"birth2":
|
45
|
+
type: time
|
46
|
+
"birth3":
|
47
|
+
type: timestamp
|
48
|
+
"data1":
|
49
|
+
type: scalar
|
50
|
+
"data2":
|
51
|
+
type: schalar
|
52
|
+
#
|
53
|
+
meta-msg: |
|
54
|
+
:enum_notexist : [/mapping/name2/type] 'string': invalid type value.
|
55
|
+
:enum_notexist : [/mapping/age2/type] 'integer': invalid type value.
|
56
|
+
:enum_notexist : [/mapping/data2/type] 'schalar': invalid type value.
|
57
|
+
#
|
58
|
+
---
|
59
|
+
name: type_unknown2
|
60
|
+
desc: unkown type
|
61
|
+
#
|
62
|
+
schema: |
|
63
|
+
type: map
|
64
|
+
mapping:
|
65
|
+
"name1":
|
66
|
+
type: str
|
67
|
+
"name2":
|
68
|
+
type: string
|
69
|
+
#
|
70
|
+
meta-msg: |
|
71
|
+
:enum_notexist : [/mapping/name2/type] 'string': invalid type value.
|
72
|
+
#
|
73
|
+
rule-msg: |
|
74
|
+
:type_unknown : [/mapping/name2/type] 'string': unknown type.
|
75
|
+
#
|
76
|
+
---
|
77
|
+
name: required_notbool1
|
78
|
+
desc: required is not boolean
|
79
|
+
#
|
80
|
+
schema: |
|
81
|
+
type: map
|
82
|
+
mapping:
|
83
|
+
"name":
|
84
|
+
type: str
|
85
|
+
required: 1
|
86
|
+
#
|
87
|
+
meta-msg: |
|
88
|
+
:type_unmatch : [/mapping/name/required] '1': not a boolean.
|
89
|
+
#
|
90
|
+
rule-msg: |
|
91
|
+
:required_notbool : [/mapping/name/required] '1': not a boolean.
|
92
|
+
# :required_notbool : [/mapping/name] 'required:' is not boolean.
|
93
|
+
#
|
94
|
+
---
|
95
|
+
name: pattern_syntaxerr
|
96
|
+
desc: pattern_syntaxerr
|
97
|
+
#
|
98
|
+
schema: |
|
99
|
+
type: str
|
100
|
+
pattern: /[A-/
|
101
|
+
#
|
102
|
+
meta-msg: |
|
103
|
+
:pattern_syntaxerr : [/pattern] '/[A-/': has regexp error.
|
104
|
+
#
|
105
|
+
rule-msg: |
|
106
|
+
:pattern_syntaxerr : [/pattern] '/[A-/': has regexp error.
|
107
|
+
# :pattern_syntaxerr : [/] 'pattern:' has regexp error (= /[A-/).
|
108
|
+
#
|
109
|
+
---
|
110
|
+
name: enum_notseq
|
111
|
+
desc: enum_notseq
|
112
|
+
#
|
113
|
+
schema: |
|
114
|
+
type: str
|
115
|
+
enum: A, B, C
|
116
|
+
#
|
117
|
+
meta-msg: |
|
118
|
+
:type_unmatch : [/enum] 'A, B, C': not a sequence.
|
119
|
+
#
|
120
|
+
rule-msg: |
|
121
|
+
:enum_notseq : [/enum] 'A, B, C': not a sequence.
|
122
|
+
# :enum_notseq : [/] 'enum:' is not a sequence.
|
123
|
+
#
|
124
|
+
---
|
125
|
+
name: enum_notscalar
|
126
|
+
desc: enum_notscalar
|
127
|
+
#
|
128
|
+
schema: |
|
129
|
+
type: seq
|
130
|
+
enum:
|
131
|
+
- A
|
132
|
+
- B
|
133
|
+
sequence:
|
134
|
+
- type: str
|
135
|
+
#
|
136
|
+
meta-msg: |
|
137
|
+
:enum_notscalar : [/] 'enum:': not available with seq or map.
|
138
|
+
#
|
139
|
+
rule-msg: |
|
140
|
+
:enum_notscalar : [/] 'enum:': not available with seq or map.
|
141
|
+
#
|
142
|
+
---
|
143
|
+
name: enum_duplicate
|
144
|
+
desc: enum_duplicate
|
145
|
+
#
|
146
|
+
schema: |
|
147
|
+
enum:
|
148
|
+
- A
|
149
|
+
- B
|
150
|
+
- A
|
151
|
+
#
|
152
|
+
meta-msg: |
|
153
|
+
:value_notunique : [/enum/2] 'A': is already used at '/enum/0'.
|
154
|
+
# :enum_duplicate : [/enum] 'A': duplicated enum value.
|
155
|
+
#
|
156
|
+
rule-msg: |
|
157
|
+
:enum_duplicate : [/enum] 'A': duplicated enum value.
|
158
|
+
#
|
159
|
+
---
|
160
|
+
name: enum_type_unmatch
|
161
|
+
desc: enum_type_unmatch
|
162
|
+
#
|
163
|
+
schema: |
|
164
|
+
enum:
|
165
|
+
- 100
|
166
|
+
- 200
|
167
|
+
#
|
168
|
+
meta-msg: |
|
169
|
+
:enum_type_unmatch : [/enum] '100': string type expected.
|
170
|
+
:enum_type_unmatch : [/enum] '200': string type expected.
|
171
|
+
#
|
172
|
+
rule-msg: |
|
173
|
+
:enum_type_unmatch : [/enum] '100': string type expected.
|
174
|
+
#
|
175
|
+
---
|
176
|
+
name: assert_notstr
|
177
|
+
desc: assert_notstr
|
178
|
+
#
|
179
|
+
schema: |
|
180
|
+
type: number
|
181
|
+
assert: 100
|
182
|
+
#
|
183
|
+
meta-msg: |
|
184
|
+
:type_unmatch : [/assert] '100': not a string.
|
185
|
+
#
|
186
|
+
rule-msg: |
|
187
|
+
:assert_notstr : [/assert] '100': not a string.
|
188
|
+
# :assert_notstr : [/] 'assert:' is not a string.
|
189
|
+
#
|
190
|
+
---
|
191
|
+
name: assert_noval
|
192
|
+
desc: assert_noval
|
193
|
+
#
|
194
|
+
schema: |
|
195
|
+
type: int
|
196
|
+
assert: value > 100
|
197
|
+
#
|
198
|
+
meta-msg: |
|
199
|
+
:pattern_unmatch : [/assert] 'value > 100': not matched to pattern /\bval\b/.
|
200
|
+
#
|
201
|
+
rule-msg: |
|
202
|
+
:assert_noval : [/assert] 'value > 100': 'val' is not used.
|
203
|
+
---
|
204
|
+
name: assert_syntaxerr
|
205
|
+
desc: assert_syntaxerr
|
206
|
+
#
|
207
|
+
schema: |
|
208
|
+
type: int
|
209
|
+
assert: 0 < val &&
|
210
|
+
#
|
211
|
+
meta-msg*:
|
212
|
+
ruby: |
|
213
|
+
:assert_syntaxerr : [/assert] '0 < val &&': expression syntax error.
|
214
|
+
java: ""
|
215
|
+
#
|
216
|
+
rule-msg*:
|
217
|
+
ruby: |
|
218
|
+
:assert_syntaxerr : [/assert] '0 < val &&': expression syntax error.
|
219
|
+
java: ~
|
220
|
+
#
|
221
|
+
---
|
222
|
+
name: range_notmap
|
223
|
+
desc: range_notmap
|
224
|
+
#
|
225
|
+
schema: |
|
226
|
+
type: int
|
227
|
+
range: 0 < val && val < 100
|
228
|
+
#
|
229
|
+
meta-msg: |
|
230
|
+
:type_unmatch : [/range] '0 < val && val < 100': not a mapping.
|
231
|
+
#
|
232
|
+
rule-msg: |
|
233
|
+
:range_notmap : [/range] '0 < val && val < 100': not a mapping.
|
234
|
+
#
|
235
|
+
---
|
236
|
+
name: range_notscalar
|
237
|
+
desc: range_notscalar
|
238
|
+
#
|
239
|
+
schema: |
|
240
|
+
type: seq
|
241
|
+
sequence:
|
242
|
+
- type: str
|
243
|
+
range: { max: 10, min: 10 }
|
244
|
+
#
|
245
|
+
meta-msg: |
|
246
|
+
:range_notscalar : [/] 'range:': is available only with scalar type.
|
247
|
+
#
|
248
|
+
rule-msg: |
|
249
|
+
:range_notscalar : [/] 'range:': is available only with scalar type.
|
250
|
+
#
|
251
|
+
---
|
252
|
+
name: range_type_unmatch
|
253
|
+
desc: range_type_unmatch
|
254
|
+
#
|
255
|
+
schema: |
|
256
|
+
type: int
|
257
|
+
range: { max: 10, min: 1.0 }
|
258
|
+
#
|
259
|
+
meta-msg: |
|
260
|
+
:range_type_unmatch : [/range/min] '1.0': not a integer.
|
261
|
+
#
|
262
|
+
rule-msg: |
|
263
|
+
:range_type_unmatch : [/range/min] '1.0': not a integer.
|
264
|
+
#
|
265
|
+
---
|
266
|
+
name: range_undefined
|
267
|
+
desc: range_undefined
|
268
|
+
#
|
269
|
+
schema: |
|
270
|
+
type: int
|
271
|
+
range: { max: 10, mim: 1 }
|
272
|
+
#
|
273
|
+
meta-msg: |
|
274
|
+
:key_undefined : [/range/mim] key 'mim:' is undefined.
|
275
|
+
# :key_undefined : [/range/mim] 'mim:': undefined key.
|
276
|
+
#
|
277
|
+
rule-msg: |
|
278
|
+
:range_undefined : [/range/mim] 'mim:': undefined key.
|
279
|
+
# :range_undefined : [/range/mim] key 'mim:' undefined key.
|
280
|
+
#
|
281
|
+
---
|
282
|
+
name: range_twomax
|
283
|
+
desc: range_twomax
|
284
|
+
#
|
285
|
+
schema: |
|
286
|
+
type: float
|
287
|
+
range: { max: 10.0, max-ex: 1.0 }
|
288
|
+
#
|
289
|
+
meta-msg: |
|
290
|
+
:range_twomax : [/range] both 'max' and 'max-ex' are not available at once.
|
291
|
+
#
|
292
|
+
rule-msg: |
|
293
|
+
:range_twomax : [/range] both 'max' and 'max-ex' are not available at once.
|
294
|
+
#
|
295
|
+
---
|
296
|
+
name: range_twomin
|
297
|
+
desc: both 'min' and 'min-ex' are not available at once.
|
298
|
+
#
|
299
|
+
schema: |
|
300
|
+
type: float
|
301
|
+
range: { min: 10.0, min-ex: 1.0 }
|
302
|
+
#
|
303
|
+
meta-msg: |
|
304
|
+
:range_twomin : [/range] both 'min' and 'min-ex' are not available at once.
|
305
|
+
#
|
306
|
+
rule-msg: |
|
307
|
+
:range_twomin : [/range] both 'min' and 'min-ex' are not available at once.
|
308
|
+
#
|
309
|
+
---
|
310
|
+
name: range_maxltmin
|
311
|
+
desc: "'max:' < 'min:'"
|
312
|
+
#
|
313
|
+
schema: |
|
314
|
+
type: map
|
315
|
+
mapping:
|
316
|
+
"EQ":
|
317
|
+
type: int
|
318
|
+
range: { max: 10, min: 10 }
|
319
|
+
"LG":
|
320
|
+
type: str
|
321
|
+
range: { max: aa, min: xx }
|
322
|
+
#
|
323
|
+
meta-msg: |
|
324
|
+
:range_maxltmin : [/mapping/LG/range] max 'aa' is less than min 'xx'.
|
325
|
+
#
|
326
|
+
rule-msg: |
|
327
|
+
:range_maxltmin : [/mapping/LG/range] max 'aa' is less than min 'xx'.
|
328
|
+
#
|
329
|
+
---
|
330
|
+
name: range_maxleminex1
|
331
|
+
desc: "'max:' < 'min-ex:'"
|
332
|
+
#
|
333
|
+
schema: |
|
334
|
+
type: str
|
335
|
+
range: { max: aa, min-ex: xx }
|
336
|
+
#
|
337
|
+
meta-msg: |
|
338
|
+
:range_maxleminex : [/range] max 'aa' is less than or equal to min-ex 'xx'.
|
339
|
+
#
|
340
|
+
rule-msg: |
|
341
|
+
:range_maxleminex : [/range] max 'aa' is less than or equal to min-ex 'xx'.
|
342
|
+
#
|
343
|
+
---
|
344
|
+
name: range_maxleminex2
|
345
|
+
desc: "'max:' == 'min-ex:'"
|
346
|
+
#
|
347
|
+
schema: |
|
348
|
+
type: int
|
349
|
+
range: { max: 10, min-ex: 10 }
|
350
|
+
#
|
351
|
+
meta-msg: |
|
352
|
+
:range_maxleminex : [/range] max '10' is less than or equal to min-ex '10'.
|
353
|
+
#
|
354
|
+
rule-msg: |
|
355
|
+
:range_maxleminex : [/range] max '10' is less than or equal to min-ex '10'.
|
356
|
+
#
|
357
|
+
---
|
358
|
+
name: range_maxexlemin1
|
359
|
+
desc: "'max-ex:' < 'min:'"
|
360
|
+
#
|
361
|
+
schema: |
|
362
|
+
type: str
|
363
|
+
range: { max-ex: aa, min: xx }
|
364
|
+
#
|
365
|
+
meta-msg: |
|
366
|
+
:range_maxexlemin : [/range] max-ex 'aa' is less than or equal to min 'xx'.
|
367
|
+
#
|
368
|
+
rule-msg: |
|
369
|
+
:range_maxexlemin : [/range] max-ex 'aa' is less than or equal to min 'xx'.
|
370
|
+
#
|
371
|
+
---
|
372
|
+
name: range_maxexlemin2
|
373
|
+
desc: "'max-ex:' == 'min:'"
|
374
|
+
#
|
375
|
+
schema: |
|
376
|
+
type: int
|
377
|
+
range: { max-ex: 10, min: 10 }
|
378
|
+
#
|
379
|
+
meta-msg: |
|
380
|
+
:range_maxexlemin : [/range] max-ex '10' is less than or equal to min '10'.
|
381
|
+
#
|
382
|
+
rule-msg: |
|
383
|
+
:range_maxexlemin : [/range] max-ex '10' is less than or equal to min '10'.
|
384
|
+
#
|
385
|
+
---
|
386
|
+
name: range_maxexleminex1
|
387
|
+
desc: "'max-ex:' < 'min:-ex'"
|
388
|
+
#
|
389
|
+
schema: |
|
390
|
+
type: str
|
391
|
+
range: { max-ex: aa, min-ex: xx }
|
392
|
+
#
|
393
|
+
meta-msg: |
|
394
|
+
:range_maxexleminex : [/range] max-ex 'aa' is less than or equal to min-ex 'xx'.
|
395
|
+
#
|
396
|
+
rule-msg: |
|
397
|
+
:range_maxexleminex : [/range] max-ex 'aa' is less than or equal to min-ex 'xx'.
|
398
|
+
#
|
399
|
+
---
|
400
|
+
name: range_maxexleminex2
|
401
|
+
desc: "'max-ex:' == 'min-ex:'"
|
402
|
+
#
|
403
|
+
schema: |
|
404
|
+
type: int
|
405
|
+
range: { max-ex: 10, min-ex: 10 }
|
406
|
+
#
|
407
|
+
meta-msg: |
|
408
|
+
:range_maxexleminex : [/range] max-ex '10' is less than or equal to min-ex '10'.
|
409
|
+
#
|
410
|
+
rule-msg: |
|
411
|
+
:range_maxexleminex : [/range] max-ex '10' is less than or equal to min-ex '10'.
|
412
|
+
#
|
413
|
+
---
|
414
|
+
name: length_notmap
|
415
|
+
desc: length_notmap
|
416
|
+
#
|
417
|
+
schema: |
|
418
|
+
type: text
|
419
|
+
length: [ 10, 4 ]
|
420
|
+
#
|
421
|
+
meta-msg: |
|
422
|
+
:type_unmatch : [/length] not a mapping.
|
423
|
+
#
|
424
|
+
rule-msg: |
|
425
|
+
:length_notmap : [/length] not a mapping.
|
426
|
+
#
|
427
|
+
---
|
428
|
+
name: length_nottext
|
429
|
+
desc: length_nottext
|
430
|
+
#
|
431
|
+
schema: |
|
432
|
+
type: number
|
433
|
+
length: { max: 10, min: 0 }
|
434
|
+
#
|
435
|
+
meta-msg: |
|
436
|
+
:length_nottext : [/] 'length:': is available only with string or text.
|
437
|
+
#
|
438
|
+
rule-msg: |
|
439
|
+
:length_nottext : [/] 'length:': is available only with string or text.
|
440
|
+
#
|
441
|
+
---
|
442
|
+
name: length_notint
|
443
|
+
desc: length_notint
|
444
|
+
#
|
445
|
+
schema: |
|
446
|
+
type: text
|
447
|
+
length: { max: 10.1 }
|
448
|
+
#
|
449
|
+
meta-msg: |
|
450
|
+
:type_unmatch : [/length/max] '10.1': not a integer.
|
451
|
+
#
|
452
|
+
rule-msg: |
|
453
|
+
:length_notint : [/length/max] '10.1': not an integer.
|
454
|
+
#
|
455
|
+
---
|
456
|
+
name: length_undefined
|
457
|
+
desc: length_undefined
|
458
|
+
#
|
459
|
+
schema: |
|
460
|
+
type: text
|
461
|
+
length: { maximum: 10 }
|
462
|
+
#
|
463
|
+
meta-msg: |
|
464
|
+
:key_undefined : [/length/maximum] key 'maximum:' is undefined.
|
465
|
+
# :key_undefined : [/length/maximum] 'maximum:': undefined key.
|
466
|
+
#
|
467
|
+
rule-msg: |
|
468
|
+
:length_undefined : [/length/maximum] 'maximum:': undefined key.
|
469
|
+
# :length_undefined : [/length/maximum] key 'maximum:' is undefined.
|
470
|
+
#
|
471
|
+
---
|
472
|
+
name: length_twomax
|
473
|
+
desc: length_twomax
|
474
|
+
#
|
475
|
+
schema: |
|
476
|
+
type: text
|
477
|
+
length: { max: 10, max-ex: 1 }
|
478
|
+
#
|
479
|
+
meta-msg: |
|
480
|
+
:length_twomax : [/length] both 'max' and 'max-ex' are not available at once.
|
481
|
+
#
|
482
|
+
rule-msg: |
|
483
|
+
:length_twomax : [/length] both 'max' and 'max-ex' are not available at once.
|
484
|
+
#
|
485
|
+
---
|
486
|
+
name: length_twomin
|
487
|
+
desc: length_twomin
|
488
|
+
#
|
489
|
+
schema: |
|
490
|
+
type: str
|
491
|
+
length: { min: 10, min-ex: 10 }
|
492
|
+
#
|
493
|
+
meta-msg: |
|
494
|
+
:length_twomin : [/length] both 'min' and 'min-ex' are not available at once.
|
495
|
+
#
|
496
|
+
rule-msg: |
|
497
|
+
:length_twomin : [/length] both 'min' and 'min-ex' are not available at once.
|
498
|
+
#
|
499
|
+
---
|
500
|
+
name: length_maxltmin
|
501
|
+
desc: "'max:' < 'min:'"
|
502
|
+
#
|
503
|
+
schema: |
|
504
|
+
type: map
|
505
|
+
mapping:
|
506
|
+
"EQ":
|
507
|
+
type: str
|
508
|
+
length: { max: 2, min: 2 }
|
509
|
+
"LT":
|
510
|
+
type: str
|
511
|
+
length: { max: 2, min: 3 }
|
512
|
+
#
|
513
|
+
meta-msg: |
|
514
|
+
:length_maxltmin : [/mapping/LT/length] max '2' is less than min '3'.
|
515
|
+
#
|
516
|
+
rule-msg: |
|
517
|
+
:length_maxltmin : [/mapping/LT/length] max '2' is less than min '3'.
|
518
|
+
#
|
519
|
+
---
|
520
|
+
name: length_maxleminex1
|
521
|
+
desc: "'max:' < 'min-ex:'"
|
522
|
+
#
|
523
|
+
schema: |
|
524
|
+
type: str
|
525
|
+
length: { max: 2, min-ex: 3 }
|
526
|
+
#
|
527
|
+
meta-msg: |
|
528
|
+
:length_maxleminex : [/length] max '2' is less than or equal to min-ex '3'.
|
529
|
+
#
|
530
|
+
rule-msg: |
|
531
|
+
:length_maxleminex : [/length] max '2' is less than or equal to min-ex '3'.
|
532
|
+
#
|
533
|
+
---
|
534
|
+
name: length_maxleminex2
|
535
|
+
desc: "'max:' == 'min-ex:'"
|
536
|
+
#
|
537
|
+
schema: |
|
538
|
+
type: str
|
539
|
+
length: { max: 2, min-ex: 2 }
|
540
|
+
#
|
541
|
+
meta-msg: |
|
542
|
+
:length_maxleminex : [/length] max '2' is less than or equal to min-ex '2'.
|
543
|
+
#
|
544
|
+
rule-msg: |
|
545
|
+
:length_maxleminex : [/length] max '2' is less than or equal to min-ex '2'.
|
546
|
+
#
|
547
|
+
---
|
548
|
+
name: length_maxexlemin1
|
549
|
+
desc: "'max-ex:' < 'min:'"
|
550
|
+
#
|
551
|
+
schema: |
|
552
|
+
type: str
|
553
|
+
length: { max-ex: 2, min: 3 }
|
554
|
+
#
|
555
|
+
meta-msg: |
|
556
|
+
:length_maxexlemin : [/length] max-ex '2' is less than or equal to min '3'.
|
557
|
+
#
|
558
|
+
rule-msg: |
|
559
|
+
:length_maxexlemin : [/length] max-ex '2' is less than or equal to min '3'.
|
560
|
+
#
|
561
|
+
---
|
562
|
+
name: length_maxexlemin2
|
563
|
+
desc: "'max-ex:' == 'min:'"
|
564
|
+
#
|
565
|
+
schema: |
|
566
|
+
type: str
|
567
|
+
length: { max-ex: 2, min: 2 }
|
568
|
+
#
|
569
|
+
meta-msg: |
|
570
|
+
:length_maxexlemin : [/length] max-ex '2' is less than or equal to min '2'.
|
571
|
+
#
|
572
|
+
rule-msg: |
|
573
|
+
:length_maxexlemin : [/length] max-ex '2' is less than or equal to min '2'.
|
574
|
+
#
|
575
|
+
---
|
576
|
+
name: length_maxexleminex1
|
577
|
+
desc: "'max-ex:' < 'min-ex:'"
|
578
|
+
#
|
579
|
+
schema: |
|
580
|
+
type: str
|
581
|
+
length: { max-ex: 2, min-ex: 3 }
|
582
|
+
#
|
583
|
+
meta-msg: |
|
584
|
+
:length_maxexleminex: [/length] max-ex '2' is less than or equal to min-ex '3'.
|
585
|
+
#
|
586
|
+
rule-msg: |
|
587
|
+
:length_maxexleminex: [/length] max-ex '2' is less than or equal to min-ex '3'.
|
588
|
+
#
|
589
|
+
---
|
590
|
+
name: length_maxexltminex2
|
591
|
+
desc: "'max-ex:' == 'min-ex:'"
|
592
|
+
#
|
593
|
+
schema: |
|
594
|
+
type: str
|
595
|
+
length: { max-ex: 2, min-ex: 2 }
|
596
|
+
#
|
597
|
+
meta-msg: |
|
598
|
+
:length_maxexleminex: [/length] max-ex '2' is less than or equal to min-ex '2'.
|
599
|
+
#
|
600
|
+
rule-msg: |
|
601
|
+
:length_maxexleminex: [/length] max-ex '2' is less than or equal to min-ex '2'.
|
602
|
+
#
|
603
|
+
---
|
604
|
+
name: sequence_notseq
|
605
|
+
desc: sequence_notseq
|
606
|
+
#
|
607
|
+
schema: |
|
608
|
+
type: seq
|
609
|
+
sequence: |-
|
610
|
+
- type: str
|
611
|
+
#
|
612
|
+
meta-msg: |
|
613
|
+
:type_unmatch : [/sequence] '- type: str': not a sequence.
|
614
|
+
#
|
615
|
+
rule-msg: |
|
616
|
+
:sequence_notseq : [/sequence] '- type: str': not a sequence.
|
617
|
+
#
|
618
|
+
---
|
619
|
+
name: sequence_noelem
|
620
|
+
desc: sequence_noelem
|
621
|
+
#
|
622
|
+
schema: |
|
623
|
+
type: seq
|
624
|
+
sequence:
|
625
|
+
#
|
626
|
+
meta-msg: |
|
627
|
+
:sequence_noelem : [/sequence] required one element.
|
628
|
+
# :type_unmatch : [/sequence] not a sequence.
|
629
|
+
#
|
630
|
+
rule-msg: |
|
631
|
+
:sequence_noelem : [/sequence] required one element.
|
632
|
+
#
|
633
|
+
---
|
634
|
+
name: sequence_toomany
|
635
|
+
desc: sequence_toomany
|
636
|
+
#
|
637
|
+
schema: |
|
638
|
+
type: seq
|
639
|
+
sequence:
|
640
|
+
- type: text
|
641
|
+
- type: text
|
642
|
+
#
|
643
|
+
meta-msg: |
|
644
|
+
:sequence_toomany : [/sequence] required just one element.
|
645
|
+
#
|
646
|
+
rule-msg: |
|
647
|
+
:sequence_toomany : [/sequence] required just one element.
|
648
|
+
#
|
649
|
+
---
|
650
|
+
name: mapping_notmap
|
651
|
+
desc: mapping_notmap
|
652
|
+
#
|
653
|
+
schema: |
|
654
|
+
type: map
|
655
|
+
mapping: |-
|
656
|
+
"name":
|
657
|
+
type: str
|
658
|
+
#
|
659
|
+
meta-msg: |
|
660
|
+
:type_unmatch : [/mapping] '"name":\n type: str': not a mapping.
|
661
|
+
#
|
662
|
+
rule-msg: |
|
663
|
+
:mapping_notmap : [/mapping] '"name":\n type: str': not a mapping.
|
664
|
+
#
|
665
|
+
---
|
666
|
+
name: mapping_noelem
|
667
|
+
desc: mapping_noelem
|
668
|
+
#
|
669
|
+
schema: |
|
670
|
+
type: map
|
671
|
+
mapping:
|
672
|
+
#
|
673
|
+
meta-msg: |
|
674
|
+
:mapping_noelem : [/mapping] required at least one element.
|
675
|
+
#
|
676
|
+
rule-msg: |
|
677
|
+
:mapping_noelem : [/mapping] required at least one element.
|
678
|
+
#
|
679
|
+
---
|
680
|
+
name: key_unknown
|
681
|
+
desc: key_unknown
|
682
|
+
#
|
683
|
+
schema: |
|
684
|
+
type: str
|
685
|
+
values:
|
686
|
+
- one
|
687
|
+
- two
|
688
|
+
#
|
689
|
+
meta-msg: |
|
690
|
+
:key_undefined : [/values] key 'values:' is undefined.
|
691
|
+
# :key_undefined : [/values] 'values:': undefined key.
|
692
|
+
#
|
693
|
+
rule-msg: |
|
694
|
+
:key_unknown : [/values] 'values:': unknown key.
|
695
|
+
# :key_unknown : [/values] key 'values:' is unknown.
|
696
|
+
#
|
697
|
+
---
|
698
|
+
name: seq_nosequence
|
699
|
+
desc: seq_nosequence
|
700
|
+
#
|
701
|
+
schema: |
|
702
|
+
type: seq
|
703
|
+
#
|
704
|
+
meta-msg: |
|
705
|
+
:seq_nosequence : [/] type 'seq' requires 'sequence:'.
|
706
|
+
#
|
707
|
+
rule-msg: |
|
708
|
+
:seq_nosequence : [/] type 'seq' requires 'sequence:'.
|
709
|
+
#
|
710
|
+
---
|
711
|
+
name: seq_conflict1
|
712
|
+
desc: type 'seq' and item 'mapping:'
|
713
|
+
#
|
714
|
+
schema: |
|
715
|
+
type: seq
|
716
|
+
sequence:
|
717
|
+
- type: str
|
718
|
+
mapping: { name: {type: str} }
|
719
|
+
meta-msg: |
|
720
|
+
:seq_conflict : [/] 'mapping:': not available with sequence.
|
721
|
+
#
|
722
|
+
rule-msg: |
|
723
|
+
:seq_conflict : [/] 'mapping:': not available with sequence.
|
724
|
+
#
|
725
|
+
---
|
726
|
+
name: seq_conflict2
|
727
|
+
desc: type 'seq' and item 'pattern:'
|
728
|
+
#
|
729
|
+
schema: |
|
730
|
+
type: seq
|
731
|
+
sequence:
|
732
|
+
- type: str
|
733
|
+
pattern: /abc/
|
734
|
+
#
|
735
|
+
meta-msg: |
|
736
|
+
:seq_conflict : [/] 'pattern:': not available with sequence.
|
737
|
+
#
|
738
|
+
rule-msg: |
|
739
|
+
:seq_conflict : [/] 'pattern:': not available with sequence.
|
740
|
+
#
|
741
|
+
---
|
742
|
+
name: seq_conflict3
|
743
|
+
desc: type 'seq' and item 'range:'
|
744
|
+
#
|
745
|
+
schema: |
|
746
|
+
type: seq
|
747
|
+
sequence:
|
748
|
+
- type: str
|
749
|
+
range: { max: 10 }
|
750
|
+
#
|
751
|
+
meta-msg: |
|
752
|
+
:range_notscalar : [/] 'range:': is available only with scalar type.
|
753
|
+
# :seq_conflict : [/] 'range:': not available with sequence.
|
754
|
+
#
|
755
|
+
rule-msg: |
|
756
|
+
:range_notscalar : [/] 'range:': is available only with scalar type.
|
757
|
+
# :seq_conflict : [/] 'range:': not available with sequence.
|
758
|
+
#
|
759
|
+
---
|
760
|
+
name: seq_conflict4
|
761
|
+
desc: type 'seq' and item 'length:'
|
762
|
+
#
|
763
|
+
schema: |
|
764
|
+
type: seq
|
765
|
+
sequence:
|
766
|
+
- type: str
|
767
|
+
length: { max: 10 }
|
768
|
+
#
|
769
|
+
meta-msg: |
|
770
|
+
:length_nottext : [/] 'length:': is available only with string or text.
|
771
|
+
# :seq_conflict : [/] 'length:': not available with sequence.
|
772
|
+
#
|
773
|
+
rule-msg: |
|
774
|
+
:length_nottext : [/] 'length:': is available only with string or text.
|
775
|
+
# :seq_conflict : [/] 'length:': not available with sequence.
|
776
|
+
#
|
777
|
+
---
|
778
|
+
name: seq_conflict5
|
779
|
+
desc: type 'seq' and item 'enum:'
|
780
|
+
#
|
781
|
+
schema: |
|
782
|
+
type: seq
|
783
|
+
sequence:
|
784
|
+
- type: str
|
785
|
+
enum: [ A, B, C ]
|
786
|
+
#
|
787
|
+
meta-msg: |
|
788
|
+
:enum_notscalar : [/] 'enum:': not available with seq or map.
|
789
|
+
# :seq_conflict : [/] 'enum:': not available with sequence.
|
790
|
+
#
|
791
|
+
rule-msg: |
|
792
|
+
:enum_notscalar : [/] 'enum:': not available with seq or map.
|
793
|
+
# :seq_conflict : [/] 'enum:': not available with sequence.
|
794
|
+
#
|
795
|
+
---
|
796
|
+
name: map_nomapping
|
797
|
+
desc: map_nomapping
|
798
|
+
#
|
799
|
+
schema: |
|
800
|
+
type: map
|
801
|
+
#
|
802
|
+
meta-msg: |
|
803
|
+
:map_nomapping : [/] type 'map' requires 'mapping:'.
|
804
|
+
#
|
805
|
+
rule-msg: |
|
806
|
+
:map_nomapping : [/] type 'map' requires 'mapping:'.
|
807
|
+
#
|
808
|
+
---
|
809
|
+
name: map_conflict1
|
810
|
+
desc: type 'map' and item 'sequence:'
|
811
|
+
#
|
812
|
+
schema: |
|
813
|
+
type: map
|
814
|
+
mapping:
|
815
|
+
"name":
|
816
|
+
type: str
|
817
|
+
sequence:
|
818
|
+
- type: str
|
819
|
+
#
|
820
|
+
meta-msg: |
|
821
|
+
:map_conflict : [/] 'sequence:': not available with mapping.
|
822
|
+
#
|
823
|
+
rule-msg: |
|
824
|
+
:map_conflict : [/] 'sequence:': not available with mapping.
|
825
|
+
#
|
826
|
+
---
|
827
|
+
name: map_conflict2
|
828
|
+
desc: type 'map' and item 'pattern:'
|
829
|
+
#
|
830
|
+
schema: |
|
831
|
+
type: map
|
832
|
+
mapping:
|
833
|
+
"name":
|
834
|
+
type: str
|
835
|
+
pattern: /foo/
|
836
|
+
#
|
837
|
+
meta-msg: |
|
838
|
+
:map_conflict : [/] 'pattern:': not available with mapping.
|
839
|
+
#
|
840
|
+
rule-msg: |
|
841
|
+
:map_conflict : [/] 'pattern:': not available with mapping.
|
842
|
+
#
|
843
|
+
---
|
844
|
+
name: map_conflict3
|
845
|
+
desc: type 'map' and item 'range:'
|
846
|
+
#
|
847
|
+
schema: |
|
848
|
+
type: map
|
849
|
+
mapping:
|
850
|
+
"name":
|
851
|
+
type: str
|
852
|
+
range: { min-ex: 5 }
|
853
|
+
#
|
854
|
+
meta-msg: |
|
855
|
+
:range_notscalar : [/] 'range:': is available only with scalar type.
|
856
|
+
# :map_conflict : [/] 'range:': not available with mapping.
|
857
|
+
#
|
858
|
+
rule-msg: |
|
859
|
+
:range_notscalar : [/] 'range:': is available only with scalar type.
|
860
|
+
# :map_conflict : [/] 'range:': not available with mapping.
|
861
|
+
#
|
862
|
+
---
|
863
|
+
name: map_conflict4
|
864
|
+
desc: type 'map' and item 'length:'
|
865
|
+
#
|
866
|
+
schema: |
|
867
|
+
type: map
|
868
|
+
mapping:
|
869
|
+
"name":
|
870
|
+
type: str
|
871
|
+
length: { min-ex: 5 }
|
872
|
+
#
|
873
|
+
meta-msg: |
|
874
|
+
:length_nottext : [/] 'length:': is available only with string or text.
|
875
|
+
# :map_conflict : [/] 'length:': not available with mapping.
|
876
|
+
#
|
877
|
+
rule-msg: |
|
878
|
+
:length_nottext : [/] 'length:': is available only with string or text.
|
879
|
+
# :map_conflict : [/] 'length:': not available with mapping.
|
880
|
+
#
|
881
|
+
---
|
882
|
+
name: scalar_confict1
|
883
|
+
desc: scalar type and item 'sequence:'
|
884
|
+
#
|
885
|
+
schema: |
|
886
|
+
type: int
|
887
|
+
sequence:
|
888
|
+
- type: str
|
889
|
+
#
|
890
|
+
meta-msg: |
|
891
|
+
:scalar_conflict : [/] 'sequence:': not available with scalar type.
|
892
|
+
#
|
893
|
+
rule-msg: |
|
894
|
+
:scalar_conflict : [/] 'sequence:': not available with scalar type.
|
895
|
+
#
|
896
|
+
---
|
897
|
+
name: scalar_confict2
|
898
|
+
desc: scalar type and item 'mapping:'
|
899
|
+
#
|
900
|
+
schema: |
|
901
|
+
type: int
|
902
|
+
mapping:
|
903
|
+
"name":
|
904
|
+
type: str
|
905
|
+
#
|
906
|
+
meta-msg: |
|
907
|
+
:scalar_conflict : [/] 'mapping:': not available with scalar type.
|
908
|
+
#
|
909
|
+
rule-msg: |
|
910
|
+
:scalar_conflict : [/] 'mapping:': not available with scalar type.
|
911
|
+
#
|
912
|
+
---
|
913
|
+
name: enum_conflict1
|
914
|
+
desc: item 'enum:' and 'range:'
|
915
|
+
#
|
916
|
+
schema: |
|
917
|
+
type: str
|
918
|
+
enum:
|
919
|
+
- aa
|
920
|
+
- bb
|
921
|
+
range: { max: xx, min: aa }
|
922
|
+
#
|
923
|
+
meta-msg: |
|
924
|
+
:enum_conflict : [/] 'range:': not available with 'enum:'.
|
925
|
+
#
|
926
|
+
rule-msg: |
|
927
|
+
:enum_conflict : [/] 'range:': not available with 'enum:'.
|
928
|
+
#
|
929
|
+
---
|
930
|
+
name: enum_conflict2
|
931
|
+
desc: item 'enum:' and 'length:'
|
932
|
+
#
|
933
|
+
schema: |
|
934
|
+
type: str
|
935
|
+
enum:
|
936
|
+
- aa
|
937
|
+
- bb
|
938
|
+
length: { max: 3 }
|
939
|
+
#
|
940
|
+
meta-msg: |
|
941
|
+
:enum_conflict : [/] 'length:': not available with 'enum:'.
|
942
|
+
#
|
943
|
+
rule-msg: |
|
944
|
+
:enum_conflict : [/] 'length:': not available with 'enum:'.
|
945
|
+
#
|
946
|
+
---
|
947
|
+
name: enum_conflict3
|
948
|
+
desc: item 'enum:' and 'pattern:'
|
949
|
+
#
|
950
|
+
schema: |
|
951
|
+
type: str
|
952
|
+
enum:
|
953
|
+
- aa
|
954
|
+
- bb
|
955
|
+
pattern: /0/
|
956
|
+
#
|
957
|
+
meta-msg: |
|
958
|
+
:enum_conflict : [/] 'pattern:': not available with 'enum:'.
|
959
|
+
#
|
960
|
+
rule-msg: |
|
961
|
+
:enum_conflict : [/] 'pattern:': not available with 'enum:'.
|
962
|
+
#
|
963
|
+
---
|
964
|
+
name: unique_notbool
|
965
|
+
desc: unique_notbool
|
966
|
+
#
|
967
|
+
schema: |
|
968
|
+
type: seq
|
969
|
+
sequence:
|
970
|
+
- type: map
|
971
|
+
mapping:
|
972
|
+
"id":
|
973
|
+
type: int
|
974
|
+
unique: 'yes'
|
975
|
+
"name":
|
976
|
+
type: str
|
977
|
+
#
|
978
|
+
meta-msg: |
|
979
|
+
:type_unmatch : [/sequence/0/mapping/id/unique] 'yes': not a boolean.
|
980
|
+
#
|
981
|
+
rule-msg: |
|
982
|
+
:unique_notbool : [/sequence/0/mapping/id/unique] 'yes': not a boolean.
|
983
|
+
#
|
984
|
+
---
|
985
|
+
name: unique_notscalar
|
986
|
+
desc: unique_notscalar
|
987
|
+
#
|
988
|
+
schema: |
|
989
|
+
type: seq
|
990
|
+
sequence:
|
991
|
+
- type: map
|
992
|
+
mapping:
|
993
|
+
"id":
|
994
|
+
type: int
|
995
|
+
unique: yes
|
996
|
+
"values":
|
997
|
+
type: seq
|
998
|
+
unique: yes
|
999
|
+
sequence:
|
1000
|
+
- type: str
|
1001
|
+
#
|
1002
|
+
meta-msg: |
|
1003
|
+
:unique_notscalar : [/sequence/0/mapping/values] 'unique:': is available only with a scalar type.
|
1004
|
+
#
|
1005
|
+
rule-msg: |
|
1006
|
+
:unique_notscalar : [/sequence/0/mapping/values] 'unique:': is available only with a scalar type.
|
1007
|
+
#
|
1008
|
+
---
|
1009
|
+
name: unique_root
|
1010
|
+
desc: unique_root
|
1011
|
+
#
|
1012
|
+
schema: |
|
1013
|
+
type: str
|
1014
|
+
unique: yes
|
1015
|
+
#
|
1016
|
+
meta-msg: |
|
1017
|
+
:unique_onroot : [/] 'unique:': is not available on root element.
|
1018
|
+
#
|
1019
|
+
rule-msg: |
|
1020
|
+
:unique_onroot : [/] 'unique:': is not available on root element.
|
1021
|
+
#
|
1022
|
+
---
|
1023
|
+
name: ident_notbool
|
1024
|
+
desc: ident_notbool
|
1025
|
+
#
|
1026
|
+
schema: |
|
1027
|
+
type: seq
|
1028
|
+
sequence:
|
1029
|
+
- type: map
|
1030
|
+
mapping:
|
1031
|
+
"id":
|
1032
|
+
type: int
|
1033
|
+
ident: 'yes'
|
1034
|
+
"name":
|
1035
|
+
type: str
|
1036
|
+
#
|
1037
|
+
meta-msg: |
|
1038
|
+
:type_unmatch : [/sequence/0/mapping/id/ident] 'yes': not a boolean.
|
1039
|
+
#
|
1040
|
+
rule-msg: |
|
1041
|
+
:ident_notbool : [/sequence/0/mapping/id/ident] 'yes': not a boolean.
|
1042
|
+
#
|
1043
|
+
---
|
1044
|
+
name: ident_notscalar
|
1045
|
+
desc: ident_notscalar
|
1046
|
+
#
|
1047
|
+
schema: |
|
1048
|
+
type: seq
|
1049
|
+
sequence:
|
1050
|
+
- type: map
|
1051
|
+
mapping:
|
1052
|
+
"id":
|
1053
|
+
type: int
|
1054
|
+
ident: yes
|
1055
|
+
"values":
|
1056
|
+
type: seq
|
1057
|
+
ident: yes
|
1058
|
+
sequence:
|
1059
|
+
- type: str
|
1060
|
+
#
|
1061
|
+
meta-msg: |
|
1062
|
+
:ident_notscalar : [/sequence/0/mapping/values] 'ident:': is available only with a scalar type.
|
1063
|
+
#
|
1064
|
+
rule-msg: |
|
1065
|
+
:ident_notscalar : [/sequence/0/mapping/values] 'ident:': is available only with a scalar type.
|
1066
|
+
#
|
1067
|
+
---
|
1068
|
+
name: ident_root
|
1069
|
+
desc: ident_root
|
1070
|
+
#
|
1071
|
+
schema: |
|
1072
|
+
type: str
|
1073
|
+
ident: yes
|
1074
|
+
#
|
1075
|
+
meta-msg: |
|
1076
|
+
:ident_onroot : [/] 'ident:': is not available on root element.
|
1077
|
+
#
|
1078
|
+
rule-msg: |
|
1079
|
+
:ident_onroot : [/] 'ident:': is not available on root element.
|
1080
|
+
#
|
1081
|
+
---
|
1082
|
+
name: ident_notmap
|
1083
|
+
desc: ident_notmap
|
1084
|
+
#
|
1085
|
+
schema: |
|
1086
|
+
type: seq
|
1087
|
+
sequence:
|
1088
|
+
- type: map
|
1089
|
+
mapping:
|
1090
|
+
"id":
|
1091
|
+
type: int
|
1092
|
+
ident: yes
|
1093
|
+
"values":
|
1094
|
+
type: seq
|
1095
|
+
sequence:
|
1096
|
+
- type: str
|
1097
|
+
ident: yes
|
1098
|
+
#
|
1099
|
+
meta-msg: |
|
1100
|
+
:ident_notmap : [/sequence/0/mapping/values/sequence/0] 'ident:': is available only with an element of mapping.
|
1101
|
+
#
|
1102
|
+
rule-msg: |
|
1103
|
+
:ident_notmap : [/sequence/0/mapping/values/sequence/0] 'ident:': is available only with an element of mapping.
|
1104
|
+
#
|