ddao-kwalify 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. data/CHANGES.txt +243 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.txt +61 -0
  4. data/bin/kwalify +13 -0
  5. data/contrib/inline-require +153 -0
  6. data/contrib/kwalify +4159 -0
  7. data/doc-api/classes/CommandOptionError.html +184 -0
  8. data/doc-api/classes/CommandOptionParser.html +325 -0
  9. data/doc-api/classes/Kwalify.html +292 -0
  10. data/doc-api/classes/Kwalify/AssertionError.html +148 -0
  11. data/doc-api/classes/Kwalify/BaseError.html +297 -0
  12. data/doc-api/classes/Kwalify/BaseParser.html +461 -0
  13. data/doc-api/classes/Kwalify/CommandOptionError.html +168 -0
  14. data/doc-api/classes/Kwalify/ErrorHelper.html +223 -0
  15. data/doc-api/classes/Kwalify/HashInterface.html +118 -0
  16. data/doc-api/classes/Kwalify/Json.html +105 -0
  17. data/doc-api/classes/Kwalify/KwalifyError.html +111 -0
  18. data/doc-api/classes/Kwalify/Main.html +339 -0
  19. data/doc-api/classes/Kwalify/MetaValidator.html +448 -0
  20. data/doc-api/classes/Kwalify/Parser.html +155 -0
  21. data/doc-api/classes/Kwalify/PlainYamlParser.html +523 -0
  22. data/doc-api/classes/Kwalify/PlainYamlParser/Alias.html +165 -0
  23. data/doc-api/classes/Kwalify/Rule.html +433 -0
  24. data/doc-api/classes/Kwalify/SchemaError.html +148 -0
  25. data/doc-api/classes/Kwalify/SyntaxError.html +185 -0
  26. data/doc-api/classes/Kwalify/Types.html +302 -0
  27. data/doc-api/classes/Kwalify/Util.html +389 -0
  28. data/doc-api/classes/Kwalify/Util/HashLike.html +246 -0
  29. data/doc-api/classes/Kwalify/Util/OrderedHash.html +330 -0
  30. data/doc-api/classes/Kwalify/ValidationError.html +148 -0
  31. data/doc-api/classes/Kwalify/Validator.html +381 -0
  32. data/doc-api/classes/Kwalify/Yaml.html +194 -0
  33. data/doc-api/classes/Kwalify/Yaml/Parser.html +1538 -0
  34. data/doc-api/classes/Kwalify/YamlParser.html +542 -0
  35. data/doc-api/classes/Kwalify/YamlSyntaxError.html +119 -0
  36. data/doc-api/classes/Test.html +107 -0
  37. data/doc-api/classes/Test/Unit.html +101 -0
  38. data/doc-api/created.rid +1 -0
  39. data/doc-api/files/__/README_txt.html +172 -0
  40. data/doc-api/files/kwalify/errors_rb.html +114 -0
  41. data/doc-api/files/kwalify/main_rb.html +118 -0
  42. data/doc-api/files/kwalify/messages_rb.html +107 -0
  43. data/doc-api/files/kwalify/meta-validator_rb.html +117 -0
  44. data/doc-api/files/kwalify/parser/base_rb.html +116 -0
  45. data/doc-api/files/kwalify/parser/yaml_rb.html +117 -0
  46. data/doc-api/files/kwalify/rule_rb.html +116 -0
  47. data/doc-api/files/kwalify/types_rb.html +114 -0
  48. data/doc-api/files/kwalify/util/assert-text-equal_rb.html +115 -0
  49. data/doc-api/files/kwalify/util/hash-interface_rb.html +114 -0
  50. data/doc-api/files/kwalify/util/hashlike_rb.html +107 -0
  51. data/doc-api/files/kwalify/util/option-parser_rb.html +107 -0
  52. data/doc-api/files/kwalify/util/ordered-hash_rb.html +107 -0
  53. data/doc-api/files/kwalify/util/testcase-helper_rb.html +115 -0
  54. data/doc-api/files/kwalify/util_rb.html +107 -0
  55. data/doc-api/files/kwalify/validator_rb.html +117 -0
  56. data/doc-api/files/kwalify/yaml-parser_rb.html +117 -0
  57. data/doc-api/files/kwalify_rb.html +121 -0
  58. data/doc-api/fr_class_index.html +57 -0
  59. data/doc-api/fr_file_index.html +45 -0
  60. data/doc-api/fr_method_index.html +168 -0
  61. data/doc-api/index.html +24 -0
  62. data/doc-api/rdoc-style.css +208 -0
  63. data/doc/docstyle.css +188 -0
  64. data/doc/img/fig01.png +0 -0
  65. data/doc/users-guide.html +2050 -0
  66. data/examples/address-book/Makefile +10 -0
  67. data/examples/address-book/address-book.schema.yaml +45 -0
  68. data/examples/address-book/address-book.yaml +36 -0
  69. data/examples/data-binding/BABEL.data.yaml +63 -0
  70. data/examples/data-binding/BABEL.schema.yaml +31 -0
  71. data/examples/data-binding/Makefile +8 -0
  72. data/examples/data-binding/Rakefile +13 -0
  73. data/examples/data-binding/main.rb +27 -0
  74. data/examples/invoice/Makefile +9 -0
  75. data/examples/invoice/invoice.schema.yaml +43 -0
  76. data/examples/invoice/invoice.yaml +32 -0
  77. data/examples/tapkit/Makefile +10 -0
  78. data/examples/tapkit/main.rb +7 -0
  79. data/examples/tapkit/tapkit.schema.yaml +146 -0
  80. data/examples/tapkit/tapkit.yaml +85 -0
  81. data/lib/kwalify.rb +67 -0
  82. data/lib/kwalify/errors.rb +128 -0
  83. data/lib/kwalify/kwalify.schema.yaml +58 -0
  84. data/lib/kwalify/main.rb +442 -0
  85. data/lib/kwalify/messages.rb +173 -0
  86. data/lib/kwalify/meta-validator.rb +276 -0
  87. data/lib/kwalify/parser/base.rb +127 -0
  88. data/lib/kwalify/parser/yaml.rb +841 -0
  89. data/lib/kwalify/rule.rb +560 -0
  90. data/lib/kwalify/templates/genclass-java.eruby +222 -0
  91. data/lib/kwalify/templates/genclass-php.eruby +104 -0
  92. data/lib/kwalify/templates/genclass-ruby.eruby +113 -0
  93. data/lib/kwalify/types.rb +156 -0
  94. data/lib/kwalify/util.rb +157 -0
  95. data/lib/kwalify/util/assert-text-equal.rb +46 -0
  96. data/lib/kwalify/util/hash-interface.rb +18 -0
  97. data/lib/kwalify/util/hashlike.rb +51 -0
  98. data/lib/kwalify/util/option-parser.rb +220 -0
  99. data/lib/kwalify/util/ordered-hash.rb +57 -0
  100. data/lib/kwalify/util/testcase-helper.rb +112 -0
  101. data/lib/kwalify/validator.rb +282 -0
  102. data/lib/kwalify/yaml-parser.rb +870 -0
  103. data/setup.rb +1585 -0
  104. data/test/Rookbook.yaml +10 -0
  105. data/test/data/users-guide/AddressBook.java.expected +40 -0
  106. data/test/data/users-guide/BABEL.data.yaml +24 -0
  107. data/test/data/users-guide/BABEL.schema.yaml +30 -0
  108. data/test/data/users-guide/ExampleAddressBook.java +47 -0
  109. data/test/data/users-guide/Group.java.expected +24 -0
  110. data/test/data/users-guide/Person.java.expected +44 -0
  111. data/test/data/users-guide/address_book.rb +52 -0
  112. data/test/data/users-guide/address_book.schema.yaml +28 -0
  113. data/test/data/users-guide/address_book.yaml +27 -0
  114. data/test/data/users-guide/answers-schema.yaml +12 -0
  115. data/test/data/users-guide/answers-validator.rb +52 -0
  116. data/test/data/users-guide/babel_genclass.result +26 -0
  117. data/test/data/users-guide/config.schema.yaml +7 -0
  118. data/test/data/users-guide/config.yaml +4 -0
  119. data/test/data/users-guide/document01a.yaml +3 -0
  120. data/test/data/users-guide/document01b.yaml +3 -0
  121. data/test/data/users-guide/document02a.yaml +4 -0
  122. data/test/data/users-guide/document02b.yaml +4 -0
  123. data/test/data/users-guide/document03a.yaml +6 -0
  124. data/test/data/users-guide/document03b.yaml +6 -0
  125. data/test/data/users-guide/document04a.yaml +9 -0
  126. data/test/data/users-guide/document04b.yaml +9 -0
  127. data/test/data/users-guide/document05a.yaml +11 -0
  128. data/test/data/users-guide/document05b.yaml +12 -0
  129. data/test/data/users-guide/document06a.yaml +15 -0
  130. data/test/data/users-guide/document06b.yaml +16 -0
  131. data/test/data/users-guide/document07a.yaml +9 -0
  132. data/test/data/users-guide/document07b.yaml +7 -0
  133. data/test/data/users-guide/document12a.json +10 -0
  134. data/test/data/users-guide/document12b.json +6 -0
  135. data/test/data/users-guide/document13a.yaml +17 -0
  136. data/test/data/users-guide/document14a.yaml +3 -0
  137. data/test/data/users-guide/document14b.yaml +3 -0
  138. data/test/data/users-guide/document15a.yaml +6 -0
  139. data/test/data/users-guide/document15b.yaml +5 -0
  140. data/test/data/users-guide/example_address_book.rb +10 -0
  141. data/test/data/users-guide/example_address_book_java.result +32 -0
  142. data/test/data/users-guide/example_address_book_ruby.result +31 -0
  143. data/test/data/users-guide/genclass_java.result +4 -0
  144. data/test/data/users-guide/howto-validation-with-parsing.rb +28 -0
  145. data/test/data/users-guide/howto-validation.rb +25 -0
  146. data/test/data/users-guide/howto3.rb +6 -0
  147. data/test/data/users-guide/howto3.result +5 -0
  148. data/test/data/users-guide/howto3.yaml +8 -0
  149. data/test/data/users-guide/howto5_databinding.result +111 -0
  150. data/test/data/users-guide/invalid01.result +3 -0
  151. data/test/data/users-guide/invalid02.result +5 -0
  152. data/test/data/users-guide/invalid03.result +5 -0
  153. data/test/data/users-guide/invalid04.result +4 -0
  154. data/test/data/users-guide/invalid05.result +11 -0
  155. data/test/data/users-guide/invalid06.result +4 -0
  156. data/test/data/users-guide/invalid07.result +3 -0
  157. data/test/data/users-guide/invalid08.result +3 -0
  158. data/test/data/users-guide/invalid12.json +8 -0
  159. data/test/data/users-guide/invalid14.result +4 -0
  160. data/test/data/users-guide/invalid15.result +4 -0
  161. data/test/data/users-guide/loadbabel.rb +27 -0
  162. data/test/data/users-guide/loadconfig.rb +16 -0
  163. data/test/data/users-guide/loadconfig.result +6 -0
  164. data/test/data/users-guide/models.rb +22 -0
  165. data/test/data/users-guide/option_ha.result +6 -0
  166. data/test/data/users-guide/option_ha_genclass_java.result +7 -0
  167. data/test/data/users-guide/schema01.yaml +3 -0
  168. data/test/data/users-guide/schema02.yaml +12 -0
  169. data/test/data/users-guide/schema03.yaml +9 -0
  170. data/test/data/users-guide/schema04.yaml +20 -0
  171. data/test/data/users-guide/schema05.yaml +29 -0
  172. data/test/data/users-guide/schema06.yaml +11 -0
  173. data/test/data/users-guide/schema12.json +12 -0
  174. data/test/data/users-guide/schema13.yaml +13 -0
  175. data/test/data/users-guide/schema14.yaml +5 -0
  176. data/test/data/users-guide/schema15.yaml +21 -0
  177. data/test/data/users-guide/valid01.result +2 -0
  178. data/test/data/users-guide/valid02.result +2 -0
  179. data/test/data/users-guide/valid03.result +2 -0
  180. data/test/data/users-guide/valid04.result +2 -0
  181. data/test/data/users-guide/valid05.result +2 -0
  182. data/test/data/users-guide/valid06.result +2 -0
  183. data/test/data/users-guide/valid07.result +2 -0
  184. data/test/data/users-guide/valid08.result +2 -0
  185. data/test/data/users-guide/valid12.result +2 -0
  186. data/test/data/users-guide/valid13.result +2 -0
  187. data/test/data/users-guide/valid14.result +2 -0
  188. data/test/data/users-guide/valid15.result +2 -0
  189. data/test/data/users-guide/validate08.rb +37 -0
  190. data/test/test-action.rb +78 -0
  191. data/test/test-action.yaml +738 -0
  192. data/test/test-databinding.rb +83 -0
  193. data/test/test-databinding.yaml +339 -0
  194. data/test/test-main.rb +157 -0
  195. data/test/test-main.yaml +384 -0
  196. data/test/test-metavalidator.rb +80 -0
  197. data/test/test-metavalidator.yaml +1179 -0
  198. data/test/test-parser-yaml.rb +57 -0
  199. data/test/test-parser-yaml.yaml +1749 -0
  200. data/test/test-rule.rb +26 -0
  201. data/test/test-rule.yaml +317 -0
  202. data/test/test-users-guide.rb +75 -0
  203. data/test/test-validator.rb +95 -0
  204. data/test/test-validator.yaml +986 -0
  205. data/test/test-yaml-parser.rb +47 -0
  206. data/test/test-yaml-parser.yaml +1226 -0
  207. data/test/test.rb +60 -0
  208. metadata +261 -0
@@ -0,0 +1,1179 @@
1
+ ##
2
+ ## $Rev: 95 $
3
+ ## $Release: 0.7.1 $
4
+ ## copyright(c) 2005-2008 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
+ #
1105
+ ---
1106
+ name: class_notmap
1107
+ desc: class_notmap
1108
+ schema: |
1109
+ type: map
1110
+ class: User
1111
+ mapping:
1112
+ "name": { type: str, required: yes }
1113
+ "email": { type: str }
1114
+ "phones":
1115
+ type: seq
1116
+ class: Phone
1117
+ sequence:
1118
+ - type: str
1119
+
1120
+ meta-msg: |
1121
+ :class_notmap : [/mapping/phones/class] 'class:': available only with map type.
1122
+ rule-msg: |
1123
+ :class_notmap : [/mapping/phones/class] 'class:': available only with map type.
1124
+ #
1125
+ ---
1126
+ name: default_nonscalarval
1127
+ desc: value is not a scalar
1128
+ schema: |
1129
+ type: map
1130
+ mapping:
1131
+ "deleted":
1132
+ type: any
1133
+ default: [ null ]
1134
+ meta-msg: |
1135
+ :type_unmatch : [/mapping/deleted/default] not a scalar.
1136
+ rule-msg: |
1137
+ :default_nonscalarval: [/mapping/deleted/default] not a scalar.
1138
+ #
1139
+ ---
1140
+ name: default_notscalar
1141
+ desc: "'default:' is not available with container"
1142
+ schema: |
1143
+ type: map
1144
+ default: null
1145
+ mapping:
1146
+ "=":
1147
+ meta-msg: |
1148
+ :default_notscalar : [/] 'default:': is available only with a scalar type.
1149
+ rule-msg: |
1150
+ :default_notscalar : [/] 'default:': is available only with a scalar type.
1151
+ #
1152
+ ---
1153
+ name: default_conflict
1154
+ desc: "'default:' is not available when 'required:' is true"
1155
+ schema: |
1156
+ type: map
1157
+ mapping:
1158
+ "name":
1159
+ type: str
1160
+ required: true
1161
+ default: ''
1162
+ meta-msg: |
1163
+ :default_conflict : [/mapping/name] 'default:': not available when 'required:' is true.
1164
+ rule-msg: |
1165
+ :default_conflict : [/mapping/name] 'default:': not available when 'required:' is true.
1166
+ #
1167
+ ---
1168
+ name: default_unmatch
1169
+ desc: "'default:' value is not matched to the type"
1170
+ schema: |
1171
+ type: map
1172
+ mapping:
1173
+ "name":
1174
+ type: str
1175
+ default: 123
1176
+ meta-msg: |
1177
+ :default_unmatch : [/mapping/name/default] '123': not a string.
1178
+ rule-msg: |
1179
+ :default_unmatch : [/mapping/name/default] '123': not a string.