anyOf.jst (943B)
1 {{# def.definitions }} 2 {{# def.errors }} 3 {{# def.setupKeyword }} 4 {{# def.setupNextLevel }} 5 6 {{ 7 var $noEmptySchema = $schema.every(function($sch) { 8 return {{# def.nonEmptySchema:$sch }}; 9 }); 10 }} 11 {{? $noEmptySchema }} 12 {{ var $currentBaseId = $it.baseId; }} 13 var {{=$errs}} = errors; 14 var {{=$valid}} = false; 15 16 {{# def.setCompositeRule }} 17 18 {{~ $schema:$sch:$i }} 19 {{ 20 $it.schema = $sch; 21 $it.schemaPath = $schemaPath + '[' + $i + ']'; 22 $it.errSchemaPath = $errSchemaPath + '/' + $i; 23 }} 24 25 {{# def.insertSubschemaCode }} 26 27 {{=$valid}} = {{=$valid}} || {{=$nextValid}}; 28 29 if (!{{=$valid}}) { 30 {{ $closingBraces += '}'; }} 31 {{~}} 32 33 {{# def.resetCompositeRule }} 34 35 {{= $closingBraces }} 36 37 if (!{{=$valid}}) { 38 {{# def.extraError:'anyOf' }} 39 } else { 40 {{# def.resetErrors }} 41 {{? it.opts.allErrors }} } {{?}} 42 43 {{# def.cleanUp }} 44 {{??}} 45 {{? $breakOnError }} 46 if (true) { 47 {{?}} 48 {{?}}