2015-06-03 03:36:59 +03:00
|
|
|
{{# def.definitions }}
|
2015-12-12 16:41:51 +03:00
|
|
|
{{# def.errors }}
|
2015-12-22 20:03:09 +03:00
|
|
|
{{# def.setupKeyword }}
|
2015-06-03 03:36:59 +03:00
|
|
|
{{# def.setupNextLevel }}
|
anyOf, enum, maxItems, minItems, maxLength, minLength, maxProperties, minProperties, multipleOf, oneOf, pattern rules
2015-05-29 00:27:16 +03:00
|
|
|
|
2015-06-13 15:01:05 +03:00
|
|
|
var {{=$errs}} = errors;
|
2015-06-12 03:43:31 +03:00
|
|
|
var prevValid{{=$lvl}} = false;
|
|
|
|
var {{=$valid}} = false;
|
2015-06-03 03:36:59 +03:00
|
|
|
|
2015-10-25 23:54:19 +03:00
|
|
|
{{# def.setCompositeRule }}
|
|
|
|
|
2015-06-03 03:36:59 +03:00
|
|
|
{{~ $schema:$sch:$i }}
|
2015-06-13 00:10:56 +03:00
|
|
|
{{? {{# def.nonEmptySchema:$sch }} }}
|
|
|
|
{{
|
|
|
|
$it.schema = $sch;
|
|
|
|
$it.schemaPath = $schemaPath + '[' + $i + ']';
|
2015-12-19 13:52:39 +03:00
|
|
|
$it.errSchemaPath = $errSchemaPath + '/' + $i;
|
2015-06-13 00:10:56 +03:00
|
|
|
}}
|
|
|
|
|
|
|
|
{{= it.validate($it) }}
|
|
|
|
{{??}}
|
|
|
|
var valid{{=$it.level}} = true;
|
|
|
|
{{?}}
|
2015-06-04 02:17:33 +03:00
|
|
|
|
2015-06-12 03:43:31 +03:00
|
|
|
{{? $i }}
|
|
|
|
if (valid{{=$it.level}} && prevValid{{=$lvl}})
|
|
|
|
{{=$valid}} = false;
|
|
|
|
else {
|
|
|
|
{{ $closingBraces += '}'; }}
|
|
|
|
{{?}}
|
|
|
|
|
|
|
|
if (valid{{=$it.level}}) {{=$valid}} = prevValid{{=$lvl}} = true;
|
2015-05-31 23:46:25 +03:00
|
|
|
{{~}}
|
anyOf, enum, maxItems, minItems, maxLength, minLength, maxProperties, minProperties, multipleOf, oneOf, pattern rules
2015-05-29 00:27:16 +03:00
|
|
|
|
2015-10-25 23:54:19 +03:00
|
|
|
{{# def.resetCompositeRule }}
|
|
|
|
|
2015-05-31 23:46:25 +03:00
|
|
|
{{= $closingBraces }}
|
|
|
|
|
2015-06-13 15:01:05 +03:00
|
|
|
if (!{{=$valid}}) {
|
2015-06-12 13:43:41 +03:00
|
|
|
{{# def.error:'oneOf' }}
|
2015-06-13 15:01:05 +03:00
|
|
|
} else {
|
2015-12-12 16:41:51 +03:00
|
|
|
{{# def.resetErrors }}
|
2015-06-12 13:43:41 +03:00
|
|
|
{{? it.opts.allErrors }} } {{?}}
|