You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
921 B

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