| 1 | {{# def.definitions }} |
| 2 | {{# def.errors }} |
| 3 | {{# def.setupKeyword }} |
| 4 | {{# def.setupNextLevel }} |
| 5 | |
| 6 | {{? {{# def.nonEmptySchema:$schema }} }} |
| 7 | {{ |
| 8 | $it.schema = $schema; |
| 9 | $it.schemaPath = $schemaPath; |
| 10 | $it.errSchemaPath = $errSchemaPath; |
| 11 | }} |
| 12 | |
| 13 | {{ |
| 14 | var $key = 'key' + $lvl |
| 15 | , $idx = 'idx' + $lvl |
| 16 | , $i = 'i' + $lvl |
| 17 | , $invalidName = '\' + ' + $key + ' + \'' |
| 18 | , $dataNxt = $it.dataLevel = it.dataLevel + 1 |
| 19 | , $nextData = 'data' + $dataNxt |
| 20 | , $dataProperties = 'dataProperties' + $lvl |
| 21 | , $ownProperties = it.opts.ownProperties |
| 22 | , $currentBaseId = it.baseId; |
| 23 | }} |
| 24 | |
| 25 | var {{=$errs}} = errors; |
| 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 }} |