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:'anyOf' }}
|
|
|
|
{{# 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 00:10:56 +03:00
|
|
|
{{
|
|
|
|
var $noEmptySchema = $schema.every(function($sch) {
|
|
|
|
return {{# def.nonEmptySchema:$sch }};
|
|
|
|
});
|
|
|
|
}}
|
|
|
|
{{? $noEmptySchema }}
|
2015-06-13 15:01:05 +03:00
|
|
|
var {{=$errs}} = errors;
|
2015-06-13 00:10:56 +03:00
|
|
|
var {{=$valid}} = false;
|
2015-06-02 03:59:32 +03:00
|
|
|
|
2015-10-25 23:54:19 +03:00
|
|
|
{{# def.setCompositeRule }}
|
|
|
|
|
2015-06-13 00:10:56 +03:00
|
|
|
{{~ $schema:$sch:$i }}
|
|
|
|
{{
|
|
|
|
$it.schema = $sch;
|
|
|
|
$it.schemaPath = $schemaPath + '[' + $i + ']';
|
|
|
|
}}
|
anyOf, enum, maxItems, minItems, maxLength, minLength, maxProperties, minProperties, multipleOf, oneOf, pattern rules
2015-05-29 00:27:16 +03:00
|
|
|
|
2015-06-13 00:10:56 +03:00
|
|
|
{{= it.validate($it) }}
|
anyOf, enum, maxItems, minItems, maxLength, minLength, maxProperties, minProperties, multipleOf, oneOf, pattern rules
2015-05-29 00:27:16 +03:00
|
|
|
|
2015-06-13 00:10:56 +03:00
|
|
|
{{=$valid}} = {{=$valid}} || valid{{=$it.level}};
|
2015-06-04 02:17:33 +03:00
|
|
|
|
2015-06-13 00:10:56 +03:00
|
|
|
if (!{{=$valid}}) {
|
|
|
|
{{ $closingBraces += '}'; }}
|
|
|
|
{{~}}
|
|
|
|
|
2015-10-25 23:54:19 +03:00
|
|
|
{{# def.resetCompositeRule }}
|
|
|
|
|
2015-06-13 00:10:56 +03:00
|
|
|
{{= $closingBraces }}
|
2015-05-31 23:46:25 +03:00
|
|
|
|
2015-06-19 01:01:39 +03:00
|
|
|
if (!{{=$valid}}) {
|
|
|
|
{{# def.addError:'anyOf' }}
|
|
|
|
} else {
|
2015-12-12 16:41:51 +03:00
|
|
|
{{# def.resetErrors }}
|
2015-06-13 00:10:56 +03:00
|
|
|
{{? it.opts.allErrors }} } {{?}}
|
2015-05-31 23:46:25 +03:00
|
|
|
|
2015-06-13 00:10:56 +03:00
|
|
|
{{# def.cleanUp }}
|
|
|
|
{{??}}
|
|
|
|
{{? $breakOnError }}
|
|
|
|
if (true) {
|
|
|
|
{{?}}
|
|
|
|
{{?}}
|