2015-06-03 03:36:59 +03:00
|
|
|
{{# def.definitions }}
|
2015-12-12 16:41:51 +03:00
|
|
|
{{# def.errors }}
|
2015-06-03 03:36:59 +03:00
|
|
|
{{# def.setup:'pattern' }}
|
anyOf, enum, maxItems, minItems, maxLength, minLength, maxProperties, minProperties, multipleOf, oneOf, pattern rules
2015-05-29 00:27:16 +03:00
|
|
|
|
2015-06-03 03:36:59 +03:00
|
|
|
{{ new RegExp($schema); /* test if regexp is valid to fail at compile time rather than in eval */}}
|
2015-08-23 01:57:16 +03:00
|
|
|
if (! {{= it.usePattern($schema) }}.test({{=$data}}) ) {
|
2015-06-12 13:43:41 +03:00
|
|
|
{{# def.error:'pattern' }}
|
2015-06-13 15:01:05 +03:00
|
|
|
} {{? $breakOnError }} else { {{?}}
|