_limitProperties.jst 376 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{# def.numberKeyword }}

{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }}
if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) {
  {{ var $errorKeyword = $keyword; }}
  {{# def.error:'_limitProperties' }}
} {{? $breakOnError }} else { {{?}}