1
|
{{# def.definitions }}
|
2
|
{{# def.errors }}
|
3
|
{{# def.setupKeyword }}
|
4
|
{{# def.setupNextLevel }}
|
5
|
|
6
|
var {{=$errs}} = errors;
|
7
|
|
8
|
{{? {{# def.nonEmptySchema:$schema }} }}
|
9
|
{{
|
10
|
$it.schema = $schema;
|
11
|
$it.schemaPath = $schemaPath;
|
12
|
$it.errSchemaPath = $errSchemaPath;
|
13
|
}}
|
14
|
|
15
|
{{
|
16
|
var $key = 'key' + $lvl
|
17
|
, $idx = 'idx' + $lvl
|
18
|
, $i = 'i' + $lvl
|
19
|
, $invalidName = '\' + ' + $key + ' + \''
|
20
|
, $dataNxt = $it.dataLevel = it.dataLevel + 1
|
21
|
, $nextData = 'data' + $dataNxt
|
22
|
, $dataProperties = 'dataProperties' + $lvl
|
23
|
, $ownProperties = it.opts.ownProperties
|
24
|
, $currentBaseId = it.baseId;
|
25
|
}}
|
26
|
|
27
|
{{? $ownProperties }}
|
28
|
var {{=$dataProperties}} = undefined;
|
29
|
{{?}}
|
30
|
{{# def.iterateProperties }}
|
31
|
var startErrs{{=$lvl}} = errors;
|
32
|
|
33
|
{{ var $passData = $key; }}
|
34
|
{{# def.setCompositeRule }}
|
35
|
{{# def.generateSubschemaCode }}
|
36
|
{{# def.optimizeValidate }}
|
37
|
{{# def.resetCompositeRule }}
|
38
|
|
39
|
if (!{{=$nextValid}}) {
|
40
|
for (var {{=$i}}=startErrs{{=$lvl}}; {{=$i}}<errors; {{=$i}}++) {
|
41
|
vErrors[{{=$i}}].propertyName = {{=$key}};
|
42
|
}
|
43
|
{{# def.extraError:'propertyNames' }}
|
44
|
{{? $breakOnError }} break; {{?}}
|
45
|
}
|
46
|
}
|
47
|
{{?}}
|
48
|
|
49
|
{{? $breakOnError }}
|
50
|
{{= $closingBraces }}
|
51
|
if ({{=$errs}} == errors) {
|
52
|
{{?}}
|
53
|
|
54
|
{{# def.cleanUp }}
|