2 module.exports = function generate_allOf(it, $keyword, $ruleType) {
4 var $schema = it.schema[$keyword];
5 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
6 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
7 var $breakOnError = !it.opts.allErrors;
8 var $it = it.util.copy(it);
9 var $closingBraces = '';
11 var $nextValid = 'valid' + $it.level;
12 var $currentBaseId = $it.baseId,
13 $allSchemasEmpty = true;
20 if ((it.opts.strictKeywords ? typeof $sch == 'object' && Object.keys($sch).length > 0 : it.util.schemaHasRules($sch, it.RULES.all))) {
21 $allSchemasEmpty = false;
23 $it.schemaPath = $schemaPath + '[' + $i + ']';
24 $it.errSchemaPath = $errSchemaPath + '/' + $i;
25 out += ' ' + (it.validate($it)) + ' ';
26 $it.baseId = $currentBaseId;
28 out += ' if (' + ($nextValid) + ') { ';
29 $closingBraces += '}';
35 if ($allSchemasEmpty) {
36 out += ' if (true) { ';
38 out += ' ' + ($closingBraces.slice(0, -1)) + ' ';