ajv/lib/dot/anyOf.jst

49 lines
943 B
Plaintext
Raw Normal View History

{{# def.definitions }}
2015-12-12 16:41:51 +03:00
{{# def.errors }}
2015-12-22 20:03:09 +03:00
{{# def.setupKeyword }}
{{# def.setupNextLevel }}
{{
var $noEmptySchema = $schema.every(function($sch) {
return {{# def.nonEmptySchema:$sch }};
});
}}
{{? $noEmptySchema }}
{{ var $currentBaseId = $it.baseId; }}
var {{=$errs}} = errors;
var {{=$valid}} = false;
2015-06-02 03:59:32 +03:00
{{# def.setCompositeRule }}
{{~ $schema:$sch:$i }}
{{
$it.schema = $sch;
$it.schemaPath = $schemaPath + '[' + $i + ']';
2015-12-19 13:52:39 +03:00
$it.errSchemaPath = $errSchemaPath + '/' + $i;
}}
{{# def.insertSubschemaCode }}
2016-12-24 01:02:41 +03:00
{{=$valid}} = {{=$valid}} || {{=$nextValid}};
if (!{{=$valid}}) {
{{ $closingBraces += '}'; }}
{{~}}
{{# def.resetCompositeRule }}
{{= $closingBraces }}
2015-05-31 23:46:25 +03:00
2015-06-19 01:01:39 +03:00
if (!{{=$valid}}) {
{{# def.extraError:'anyOf' }}
2015-06-19 01:01:39 +03:00
} else {
2015-12-12 16:41:51 +03:00
{{# def.resetErrors }}
{{? it.opts.allErrors }} } {{?}}
2015-05-31 23:46:25 +03:00
{{# def.cleanUp }}
{{??}}
{{? $breakOnError }}
if (true) {
{{?}}
{{?}}