fast-json-stringify 2.7.10 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1750 +1,1134 @@
1
- // This file is autogenerated by build-schema-validator.js, do not edit
1
+ /* CODE GENERATED BY 'build-schema-validator.js' DO NOT EDIT! */
2
+ "use strict";
3
+ module.exports = validate10;
4
+ module.exports.default = validate10;
5
+ const schema11 = {"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true};
6
+ const schema12 = {"type":"integer","minimum":0};
7
+ const schema18 = {"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]};
8
+ const schema20 = {"enum":["array","boolean","integer","null","number","object","string"]};
9
+ const formats0 = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
10
+ const formats2 = require("ajv-formats/dist/formats").fullFormats.uri;
11
+ const formats6 = require("ajv-formats/dist/formats").fullFormats.regex;
12
+ const schema13 = {"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]};
2
13
 
3
- function nop () { return true }
14
+ function validate11(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
15
+ let vErrors = null;
16
+ let errors = 0;
17
+ const _errs1 = errors;
18
+ if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){
19
+ validate11.errors = [{instancePath,schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
20
+ return false;
21
+ }
22
+ if(errors === _errs1){
23
+ if((typeof data == "number") && (isFinite(data))){
24
+ if(data < 0 || isNaN(data)){
25
+ validate11.errors = [{instancePath,schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];
26
+ return false;
27
+ }
28
+ }
29
+ }
30
+ validate11.errors = vErrors;
31
+ return errors === 0;
32
+ }
4
33
 
5
- 'use strict';
6
- var formats = require('ajv/lib/compile/formats')();
7
- var equal = require('ajv/lib/compile/equal');
8
- var validate = (function() {
9
- var refVal = [];
10
- var refVal1 = {
11
- "type": "integer",
12
- "minimum": 0
13
- };
14
- refVal[1] = refVal1;
15
- var refVal2 = (function() {
16
- return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
17
- 'use strict';
18
- var vErrors = null;
19
- var errors = 0;
20
- var errs_1 = errors;
21
- var errs_2 = errors;
22
- if ((typeof data !== "number" || (data % 1) || data !== data)) {
23
- validate.errors = [{
24
- keyword: 'type',
25
- dataPath: (dataPath || '') + "",
26
- schemaPath: '#/definitions/nonNegativeInteger/type',
27
- params: {
28
- type: 'integer'
29
- },
30
- message: 'should be integer'
31
- }];
32
- return false;
33
- }
34
- if (typeof data === "number") {
35
- if (data < 0 || data !== data) {
36
- validate.errors = [{
37
- keyword: 'minimum',
38
- dataPath: (dataPath || '') + "",
39
- schemaPath: '#/definitions/nonNegativeInteger/minimum',
40
- params: {
41
- comparison: '>=',
42
- limit: 0,
43
- exclusive: false
44
- },
45
- message: 'should be >= 0'
46
- }];
47
- return false;
48
- }
49
- }
50
- var valid2 = errors === errs_2;
51
- var valid1 = errors === errs_1;
52
- validate.errors = vErrors;
53
- return errors === 0;
54
- };
55
- })();
56
- refVal2.schema = {
57
- "allOf": [{
58
- "$ref": "#/definitions/nonNegativeInteger"
59
- }, {
60
- "default": 0
61
- }]
62
- };
63
- refVal2.errors = null;
64
- refVal[2] = refVal2;
65
- var refVal3 = (function() {
66
- return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
67
- 'use strict';
68
- var vErrors = null;
69
- var errors = 0;
70
- if (rootData === undefined) rootData = data;
71
- if (Array.isArray(data)) {
72
- if (data.length < 1) {
73
- validate.errors = [{
74
- keyword: 'minItems',
75
- dataPath: (dataPath || '') + "",
76
- schemaPath: '#/minItems',
77
- params: {
78
- limit: 1
79
- },
80
- message: 'should NOT have fewer than 1 items'
81
- }];
82
- return false;
83
- } else {
84
- var errs__0 = errors;
85
- var valid0;
86
- for (var i0 = 0; i0 < data.length; i0++) {
87
- var errs_1 = errors;
88
- if (!nop(data[i0], (dataPath || '') + '[' + i0 + ']', data, i0, rootData)) {
89
- if (vErrors === null) vErrors = nop.errors;
90
- else vErrors = vErrors.concat(nop.errors);
91
- errors = vErrors.length;
92
- }
93
- var valid1 = errors === errs_1;
94
- if (!valid1) break;
95
- }
96
- }
97
- } else {
98
- validate.errors = [{
99
- keyword: 'type',
100
- dataPath: (dataPath || '') + "",
101
- schemaPath: '#/type',
102
- params: {
103
- type: 'array'
104
- },
105
- message: 'should be array'
106
- }];
107
- return false;
108
- }
109
- validate.errors = vErrors;
110
- return errors === 0;
111
- };
112
- })();
113
- refVal3.schema = {
114
- "type": "array",
115
- "minItems": 1,
116
- "items": {
117
- "$ref": "#"
118
- }
119
- };
120
- refVal3.errors = null;
121
- refVal[3] = refVal3;
122
- var refVal4 = {
123
- "type": "array",
124
- "items": {
125
- "type": "string"
126
- },
127
- "uniqueItems": true,
128
- "default": []
129
- };
130
- refVal[4] = refVal4;
131
- var refVal5 = {
132
- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
133
- };
134
- refVal[5] = refVal5;
135
- return function validate(data, dataPath, parentData, parentDataProperty, rootData) {
136
- 'use strict'; /*# sourceURL=http://json-schema.org/draft-07/schema# */
137
- var vErrors = null;
138
- var errors = 0;
139
- if (rootData === undefined) rootData = data;
140
- if ((!data || typeof data !== "object" || Array.isArray(data)) && typeof data !== "boolean") {
141
- validate.errors = [{
142
- keyword: 'type',
143
- dataPath: (dataPath || '') + "",
144
- schemaPath: '#/type',
145
- params: {
146
- type: 'object,boolean'
147
- },
148
- message: 'should be object,boolean'
149
- }];
150
- return false;
151
- }
152
- if ((data && typeof data === "object" && !Array.isArray(data))) {
153
- var errs__0 = errors;
154
- var valid1 = true;
155
- var data1 = data.$id;
156
- if (data1 === undefined) {
157
- valid1 = true;
158
- } else {
159
- var errs_1 = errors;
160
- if (errors === errs_1) {
161
- if (typeof data1 === "string") {
162
- if (!formats['uri-reference'].test(data1)) {
163
- validate.errors = [{
164
- keyword: 'format',
165
- dataPath: (dataPath || '') + '.$id',
166
- schemaPath: '#/properties/%24id/format',
167
- params: {
168
- format: 'uri-reference'
169
- },
170
- message: 'should match format "uri-reference"'
171
- }];
172
- return false;
173
- }
174
- } else {
175
- validate.errors = [{
176
- keyword: 'type',
177
- dataPath: (dataPath || '') + '.$id',
178
- schemaPath: '#/properties/%24id/type',
179
- params: {
180
- type: 'string'
181
- },
182
- message: 'should be string'
183
- }];
184
- return false;
185
- }
186
- }
187
- var valid1 = errors === errs_1;
188
- }
189
- if (valid1) {
190
- var data1 = data.$schema;
191
- if (data1 === undefined) {
192
- valid1 = true;
193
- } else {
194
- var errs_1 = errors;
195
- if (errors === errs_1) {
196
- if (typeof data1 === "string") {
197
- if (!formats.uri.test(data1)) {
198
- validate.errors = [{
199
- keyword: 'format',
200
- dataPath: (dataPath || '') + '.$schema',
201
- schemaPath: '#/properties/%24schema/format',
202
- params: {
203
- format: 'uri'
204
- },
205
- message: 'should match format "uri"'
206
- }];
207
- return false;
208
- }
209
- } else {
210
- validate.errors = [{
211
- keyword: 'type',
212
- dataPath: (dataPath || '') + '.$schema',
213
- schemaPath: '#/properties/%24schema/type',
214
- params: {
215
- type: 'string'
216
- },
217
- message: 'should be string'
218
- }];
219
- return false;
220
- }
221
- }
222
- var valid1 = errors === errs_1;
223
- }
224
- if (valid1) {
225
- var data1 = data.$ref;
226
- if (data1 === undefined) {
227
- valid1 = true;
228
- } else {
229
- var errs_1 = errors;
230
- if (errors === errs_1) {
231
- if (typeof data1 === "string") {
232
- if (!formats['uri-reference'].test(data1)) {
233
- validate.errors = [{
234
- keyword: 'format',
235
- dataPath: (dataPath || '') + '.$ref',
236
- schemaPath: '#/properties/%24ref/format',
237
- params: {
238
- format: 'uri-reference'
239
- },
240
- message: 'should match format "uri-reference"'
241
- }];
242
- return false;
243
- }
244
- } else {
245
- validate.errors = [{
246
- keyword: 'type',
247
- dataPath: (dataPath || '') + '.$ref',
248
- schemaPath: '#/properties/%24ref/type',
249
- params: {
250
- type: 'string'
251
- },
252
- message: 'should be string'
253
- }];
254
- return false;
255
- }
256
- }
257
- var valid1 = errors === errs_1;
258
- }
259
- if (valid1) {
260
- if (data.$comment === undefined) {
261
- valid1 = true;
262
- } else {
263
- var errs_1 = errors;
264
- if (typeof data.$comment !== "string") {
265
- validate.errors = [{
266
- keyword: 'type',
267
- dataPath: (dataPath || '') + '.$comment',
268
- schemaPath: '#/properties/%24comment/type',
269
- params: {
270
- type: 'string'
271
- },
272
- message: 'should be string'
273
- }];
274
- return false;
275
- }
276
- var valid1 = errors === errs_1;
277
- }
278
- if (valid1) {
279
- if (data.title === undefined) {
280
- valid1 = true;
281
- } else {
282
- var errs_1 = errors;
283
- if (typeof data.title !== "string") {
284
- validate.errors = [{
285
- keyword: 'type',
286
- dataPath: (dataPath || '') + '.title',
287
- schemaPath: '#/properties/title/type',
288
- params: {
289
- type: 'string'
290
- },
291
- message: 'should be string'
292
- }];
293
- return false;
294
- }
295
- var valid1 = errors === errs_1;
296
- }
297
- if (valid1) {
298
- if (data.description === undefined) {
299
- valid1 = true;
300
- } else {
301
- var errs_1 = errors;
302
- if (typeof data.description !== "string") {
303
- validate.errors = [{
304
- keyword: 'type',
305
- dataPath: (dataPath || '') + '.description',
306
- schemaPath: '#/properties/description/type',
307
- params: {
308
- type: 'string'
309
- },
310
- message: 'should be string'
311
- }];
312
- return false;
313
- }
314
- var valid1 = errors === errs_1;
315
- }
316
- if (valid1) {
317
- if (valid1) {
318
- if (data.readOnly === undefined) {
319
- valid1 = true;
320
- } else {
321
- var errs_1 = errors;
322
- if (typeof data.readOnly !== "boolean") {
323
- validate.errors = [{
324
- keyword: 'type',
325
- dataPath: (dataPath || '') + '.readOnly',
326
- schemaPath: '#/properties/readOnly/type',
327
- params: {
328
- type: 'boolean'
329
- },
330
- message: 'should be boolean'
331
- }];
332
- return false;
333
- }
334
- var valid1 = errors === errs_1;
335
- }
336
- if (valid1) {
337
- if (data.examples === undefined) {
338
- valid1 = true;
339
- } else {
340
- var errs_1 = errors;
341
- if (Array.isArray(data.examples)) {
342
- var errs__1 = errors;
343
- var valid1;
344
- } else {
345
- validate.errors = [{
346
- keyword: 'type',
347
- dataPath: (dataPath || '') + '.examples',
348
- schemaPath: '#/properties/examples/type',
349
- params: {
350
- type: 'array'
351
- },
352
- message: 'should be array'
353
- }];
354
- return false;
355
- }
356
- var valid1 = errors === errs_1;
357
- }
358
- if (valid1) {
359
- var data1 = data.multipleOf;
360
- if (data1 === undefined) {
361
- valid1 = true;
362
- } else {
363
- var errs_1 = errors;
364
- if (typeof data1 === "number") {
365
- if (data1 <= 0 || data1 !== data1) {
366
- validate.errors = [{
367
- keyword: 'exclusiveMinimum',
368
- dataPath: (dataPath || '') + '.multipleOf',
369
- schemaPath: '#/properties/multipleOf/exclusiveMinimum',
370
- params: {
371
- comparison: '>',
372
- limit: 0,
373
- exclusive: true
374
- },
375
- message: 'should be > 0'
376
- }];
377
- return false;
378
- }
379
- } else {
380
- validate.errors = [{
381
- keyword: 'type',
382
- dataPath: (dataPath || '') + '.multipleOf',
383
- schemaPath: '#/properties/multipleOf/type',
384
- params: {
385
- type: 'number'
386
- },
387
- message: 'should be number'
388
- }];
389
- return false;
390
- }
391
- var valid1 = errors === errs_1;
392
- }
393
- if (valid1) {
394
- if (data.maximum === undefined) {
395
- valid1 = true;
396
- } else {
397
- var errs_1 = errors;
398
- if (typeof data.maximum !== "number") {
399
- validate.errors = [{
400
- keyword: 'type',
401
- dataPath: (dataPath || '') + '.maximum',
402
- schemaPath: '#/properties/maximum/type',
403
- params: {
404
- type: 'number'
405
- },
406
- message: 'should be number'
407
- }];
408
- return false;
409
- }
410
- var valid1 = errors === errs_1;
411
- }
412
- if (valid1) {
413
- if (data.exclusiveMaximum === undefined) {
414
- valid1 = true;
415
- } else {
416
- var errs_1 = errors;
417
- if (typeof data.exclusiveMaximum !== "number") {
418
- validate.errors = [{
419
- keyword: 'type',
420
- dataPath: (dataPath || '') + '.exclusiveMaximum',
421
- schemaPath: '#/properties/exclusiveMaximum/type',
422
- params: {
423
- type: 'number'
424
- },
425
- message: 'should be number'
426
- }];
427
- return false;
428
- }
429
- var valid1 = errors === errs_1;
430
- }
431
- if (valid1) {
432
- if (data.minimum === undefined) {
433
- valid1 = true;
434
- } else {
435
- var errs_1 = errors;
436
- if (typeof data.minimum !== "number") {
437
- validate.errors = [{
438
- keyword: 'type',
439
- dataPath: (dataPath || '') + '.minimum',
440
- schemaPath: '#/properties/minimum/type',
441
- params: {
442
- type: 'number'
443
- },
444
- message: 'should be number'
445
- }];
446
- return false;
447
- }
448
- var valid1 = errors === errs_1;
449
- }
450
- if (valid1) {
451
- if (data.exclusiveMinimum === undefined) {
452
- valid1 = true;
453
- } else {
454
- var errs_1 = errors;
455
- if (typeof data.exclusiveMinimum !== "number") {
456
- validate.errors = [{
457
- keyword: 'type',
458
- dataPath: (dataPath || '') + '.exclusiveMinimum',
459
- schemaPath: '#/properties/exclusiveMinimum/type',
460
- params: {
461
- type: 'number'
462
- },
463
- message: 'should be number'
464
- }];
465
- return false;
466
- }
467
- var valid1 = errors === errs_1;
468
- }
469
- if (valid1) {
470
- var data1 = data.maxLength;
471
- if (data1 === undefined) {
472
- valid1 = true;
473
- } else {
474
- var errs_1 = errors;
475
- var errs_2 = errors;
476
- if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
477
- validate.errors = [{
478
- keyword: 'type',
479
- dataPath: (dataPath || '') + '.maxLength',
480
- schemaPath: '#/definitions/nonNegativeInteger/type',
481
- params: {
482
- type: 'integer'
483
- },
484
- message: 'should be integer'
485
- }];
486
- return false;
487
- }
488
- if (typeof data1 === "number") {
489
- if (data1 < 0 || data1 !== data1) {
490
- validate.errors = [{
491
- keyword: 'minimum',
492
- dataPath: (dataPath || '') + '.maxLength',
493
- schemaPath: '#/definitions/nonNegativeInteger/minimum',
494
- params: {
495
- comparison: '>=',
496
- limit: 0,
497
- exclusive: false
498
- },
499
- message: 'should be >= 0'
500
- }];
501
- return false;
502
- }
503
- }
504
- var valid2 = errors === errs_2;
505
- var valid1 = errors === errs_1;
506
- }
507
- if (valid1) {
508
- if (data.minLength === undefined) {
509
- valid1 = true;
510
- } else {
511
- var errs_1 = errors;
512
- if (!refVal2(data.minLength, (dataPath || '') + '.minLength', data, 'minLength', rootData)) {
513
- if (vErrors === null) vErrors = refVal2.errors;
514
- else vErrors = vErrors.concat(refVal2.errors);
515
- errors = vErrors.length;
516
- }
517
- var valid1 = errors === errs_1;
518
- }
519
- if (valid1) {
520
- var data1 = data.pattern;
521
- if (data1 === undefined) {
522
- valid1 = true;
523
- } else {
524
- var errs_1 = errors;
525
- if (errors === errs_1) {
526
- if (typeof data1 === "string") {
527
- if (!formats.regex(data1)) {
528
- validate.errors = [{
529
- keyword: 'format',
530
- dataPath: (dataPath || '') + '.pattern',
531
- schemaPath: '#/properties/pattern/format',
532
- params: {
533
- format: 'regex'
534
- },
535
- message: 'should match format "regex"'
536
- }];
537
- return false;
538
- }
539
- } else {
540
- validate.errors = [{
541
- keyword: 'type',
542
- dataPath: (dataPath || '') + '.pattern',
543
- schemaPath: '#/properties/pattern/type',
544
- params: {
545
- type: 'string'
546
- },
547
- message: 'should be string'
548
- }];
549
- return false;
550
- }
551
- }
552
- var valid1 = errors === errs_1;
553
- }
554
- if (valid1) {
555
- if (data.additionalItems === undefined) {
556
- valid1 = true;
557
- } else {
558
- var errs_1 = errors;
559
- if (!validate(data.additionalItems, (dataPath || '') + '.additionalItems', data, 'additionalItems', rootData)) {
560
- if (vErrors === null) vErrors = validate.errors;
561
- else vErrors = vErrors.concat(validate.errors);
562
- errors = vErrors.length;
563
- }
564
- var valid1 = errors === errs_1;
565
- }
566
- if (valid1) {
567
- var data1 = data.items;
568
- if (data1 === undefined) {
569
- valid1 = true;
570
- } else {
571
- var errs_1 = errors;
572
- var errs__1 = errors;
573
- var valid1 = false;
574
- var errs_2 = errors;
575
- if (!validate(data1, (dataPath || '') + '.items', data, 'items', rootData)) {
576
- if (vErrors === null) vErrors = validate.errors;
577
- else vErrors = vErrors.concat(validate.errors);
578
- errors = vErrors.length;
579
- }
580
- var valid2 = errors === errs_2;
581
- valid1 = valid1 || valid2;
582
- if (!valid1) {
583
- var errs_2 = errors;
584
- if (!refVal3(data1, (dataPath || '') + '.items', data, 'items', rootData)) {
585
- if (vErrors === null) vErrors = refVal3.errors;
586
- else vErrors = vErrors.concat(refVal3.errors);
587
- errors = vErrors.length;
588
- }
589
- var valid2 = errors === errs_2;
590
- valid1 = valid1 || valid2;
591
- }
592
- if (!valid1) {
593
- var err = {
594
- keyword: 'anyOf',
595
- dataPath: (dataPath || '') + '.items',
596
- schemaPath: '#/properties/items/anyOf',
597
- params: {},
598
- message: 'should match some schema in anyOf'
599
- };
600
- if (vErrors === null) vErrors = [err];
601
- else vErrors.push(err);
602
- errors++;
603
- validate.errors = vErrors;
604
- return false;
605
- } else {
606
- errors = errs__1;
607
- if (vErrors !== null) {
608
- if (errs__1) vErrors.length = errs__1;
609
- else vErrors = null;
610
- }
611
- }
612
- var valid1 = errors === errs_1;
613
- }
614
- if (valid1) {
615
- var data1 = data.maxItems;
616
- if (data1 === undefined) {
617
- valid1 = true;
618
- } else {
619
- var errs_1 = errors;
620
- var errs_2 = errors;
621
- if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
622
- validate.errors = [{
623
- keyword: 'type',
624
- dataPath: (dataPath || '') + '.maxItems',
625
- schemaPath: '#/definitions/nonNegativeInteger/type',
626
- params: {
627
- type: 'integer'
628
- },
629
- message: 'should be integer'
630
- }];
631
- return false;
632
- }
633
- if (typeof data1 === "number") {
634
- if (data1 < 0 || data1 !== data1) {
635
- validate.errors = [{
636
- keyword: 'minimum',
637
- dataPath: (dataPath || '') + '.maxItems',
638
- schemaPath: '#/definitions/nonNegativeInteger/minimum',
639
- params: {
640
- comparison: '>=',
641
- limit: 0,
642
- exclusive: false
643
- },
644
- message: 'should be >= 0'
645
- }];
646
- return false;
647
- }
648
- }
649
- var valid2 = errors === errs_2;
650
- var valid1 = errors === errs_1;
651
- }
652
- if (valid1) {
653
- if (data.minItems === undefined) {
654
- valid1 = true;
655
- } else {
656
- var errs_1 = errors;
657
- if (!refVal[2](data.minItems, (dataPath || '') + '.minItems', data, 'minItems', rootData)) {
658
- if (vErrors === null) vErrors = refVal[2].errors;
659
- else vErrors = vErrors.concat(refVal[2].errors);
660
- errors = vErrors.length;
661
- }
662
- var valid1 = errors === errs_1;
663
- }
664
- if (valid1) {
665
- if (data.uniqueItems === undefined) {
666
- valid1 = true;
667
- } else {
668
- var errs_1 = errors;
669
- if (typeof data.uniqueItems !== "boolean") {
670
- validate.errors = [{
671
- keyword: 'type',
672
- dataPath: (dataPath || '') + '.uniqueItems',
673
- schemaPath: '#/properties/uniqueItems/type',
674
- params: {
675
- type: 'boolean'
676
- },
677
- message: 'should be boolean'
678
- }];
679
- return false;
680
- }
681
- var valid1 = errors === errs_1;
682
- }
683
- if (valid1) {
684
- if (data.contains === undefined) {
685
- valid1 = true;
686
- } else {
687
- var errs_1 = errors;
688
- if (!validate(data.contains, (dataPath || '') + '.contains', data, 'contains', rootData)) {
689
- if (vErrors === null) vErrors = validate.errors;
690
- else vErrors = vErrors.concat(validate.errors);
691
- errors = vErrors.length;
692
- }
693
- var valid1 = errors === errs_1;
694
- }
695
- if (valid1) {
696
- var data1 = data.maxProperties;
697
- if (data1 === undefined) {
698
- valid1 = true;
699
- } else {
700
- var errs_1 = errors;
701
- var errs_2 = errors;
702
- if ((typeof data1 !== "number" || (data1 % 1) || data1 !== data1)) {
703
- validate.errors = [{
704
- keyword: 'type',
705
- dataPath: (dataPath || '') + '.maxProperties',
706
- schemaPath: '#/definitions/nonNegativeInteger/type',
707
- params: {
708
- type: 'integer'
709
- },
710
- message: 'should be integer'
711
- }];
712
- return false;
713
- }
714
- if (typeof data1 === "number") {
715
- if (data1 < 0 || data1 !== data1) {
716
- validate.errors = [{
717
- keyword: 'minimum',
718
- dataPath: (dataPath || '') + '.maxProperties',
719
- schemaPath: '#/definitions/nonNegativeInteger/minimum',
720
- params: {
721
- comparison: '>=',
722
- limit: 0,
723
- exclusive: false
724
- },
725
- message: 'should be >= 0'
726
- }];
727
- return false;
728
- }
729
- }
730
- var valid2 = errors === errs_2;
731
- var valid1 = errors === errs_1;
732
- }
733
- if (valid1) {
734
- if (data.minProperties === undefined) {
735
- valid1 = true;
736
- } else {
737
- var errs_1 = errors;
738
- if (!refVal[2](data.minProperties, (dataPath || '') + '.minProperties', data, 'minProperties', rootData)) {
739
- if (vErrors === null) vErrors = refVal[2].errors;
740
- else vErrors = vErrors.concat(refVal[2].errors);
741
- errors = vErrors.length;
742
- }
743
- var valid1 = errors === errs_1;
744
- }
745
- if (valid1) {
746
- var data1 = data.required;
747
- if (data1 === undefined) {
748
- valid1 = true;
749
- } else {
750
- var errs_1 = errors;
751
- var errs_2 = errors;
752
- if (Array.isArray(data1)) {
753
- var errs__2 = errors;
754
- var valid2;
755
- for (var i2 = 0; i2 < data1.length; i2++) {
756
- var errs_3 = errors;
757
- if (typeof data1[i2] !== "string") {
758
- validate.errors = [{
759
- keyword: 'type',
760
- dataPath: (dataPath || '') + '.required[' + i2 + ']',
761
- schemaPath: '#/definitions/stringArray/items/type',
762
- params: {
763
- type: 'string'
764
- },
765
- message: 'should be string'
766
- }];
767
- return false;
768
- }
769
- var valid3 = errors === errs_3;
770
- if (!valid3) break;
771
- }
772
- if (errs__2 == errors) {
773
- var i = data1.length,
774
- valid2 = true,
775
- j;
776
- if (i > 1) {
777
- var itemIndices = {},
778
- item;
779
- for (; i--;) {
780
- var item = data1[i];
781
- if (typeof item !== "string") continue;
782
- if (typeof itemIndices[item] == 'number') {
783
- valid2 = false;
784
- j = itemIndices[item];
785
- break;
786
- }
787
- itemIndices[item] = i;
788
- }
789
- }
790
- if (!valid2) {
791
- validate.errors = [{
792
- keyword: 'uniqueItems',
793
- dataPath: (dataPath || '') + '.required',
794
- schemaPath: '#/definitions/stringArray/uniqueItems',
795
- params: {
796
- i: i,
797
- j: j
798
- },
799
- message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'
800
- }];
801
- return false;
802
- }
803
- }
804
- } else {
805
- validate.errors = [{
806
- keyword: 'type',
807
- dataPath: (dataPath || '') + '.required',
808
- schemaPath: '#/definitions/stringArray/type',
809
- params: {
810
- type: 'array'
811
- },
812
- message: 'should be array'
813
- }];
814
- return false;
815
- }
816
- var valid2 = errors === errs_2;
817
- var valid1 = errors === errs_1;
818
- }
819
- if (valid1) {
820
- if (data.additionalProperties === undefined) {
821
- valid1 = true;
822
- } else {
823
- var errs_1 = errors;
824
- if (!validate(data.additionalProperties, (dataPath || '') + '.additionalProperties', data, 'additionalProperties', rootData)) {
825
- if (vErrors === null) vErrors = validate.errors;
826
- else vErrors = vErrors.concat(validate.errors);
827
- errors = vErrors.length;
828
- }
829
- var valid1 = errors === errs_1;
830
- }
831
- if (valid1) {
832
- var data1 = data.definitions;
833
- if (data1 === undefined) {
834
- valid1 = true;
835
- } else {
836
- var errs_1 = errors;
837
- if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
838
- var errs__1 = errors;
839
- var valid2 = true;
840
- for (var key1 in data1) {
841
- var errs_2 = errors;
842
- if (!validate(data1[key1], (dataPath || '') + '.definitions[\'' + key1 + '\']', data1, key1, rootData)) {
843
- if (vErrors === null) vErrors = validate.errors;
844
- else vErrors = vErrors.concat(validate.errors);
845
- errors = vErrors.length;
846
- }
847
- var valid2 = errors === errs_2;
848
- if (!valid2) break;
849
- }
850
- } else {
851
- validate.errors = [{
852
- keyword: 'type',
853
- dataPath: (dataPath || '') + '.definitions',
854
- schemaPath: '#/properties/definitions/type',
855
- params: {
856
- type: 'object'
857
- },
858
- message: 'should be object'
859
- }];
860
- return false;
861
- }
862
- var valid1 = errors === errs_1;
863
- }
864
- if (valid1) {
865
- var data1 = data.properties;
866
- if (data1 === undefined) {
867
- valid1 = true;
868
- } else {
869
- var errs_1 = errors;
870
- if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
871
- var errs__1 = errors;
872
- var valid2 = true;
873
- for (var key1 in data1) {
874
- var errs_2 = errors;
875
- if (!validate(data1[key1], (dataPath || '') + '.properties[\'' + key1 + '\']', data1, key1, rootData)) {
876
- if (vErrors === null) vErrors = validate.errors;
877
- else vErrors = vErrors.concat(validate.errors);
878
- errors = vErrors.length;
879
- }
880
- var valid2 = errors === errs_2;
881
- if (!valid2) break;
882
- }
883
- } else {
884
- validate.errors = [{
885
- keyword: 'type',
886
- dataPath: (dataPath || '') + '.properties',
887
- schemaPath: '#/properties/properties/type',
888
- params: {
889
- type: 'object'
890
- },
891
- message: 'should be object'
892
- }];
893
- return false;
894
- }
895
- var valid1 = errors === errs_1;
896
- }
897
- if (valid1) {
898
- var data1 = data.patternProperties;
899
- if (data1 === undefined) {
900
- valid1 = true;
901
- } else {
902
- var errs_1 = errors;
903
- if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
904
- var errs__1 = errors;
905
- for (var key1 in data1) {
906
- var startErrs1 = errors;
907
- var data2 = key1;
908
- var errs_2 = errors;
909
- if (errors === errs_2) {
910
- if (typeof data2 === "string") {
911
- if (!formats.regex(data2)) {
912
- var err = {
913
- keyword: 'format',
914
- dataPath: (dataPath || '') + '.patternProperties',
915
- schemaPath: '#/properties/patternProperties/propertyNames/format',
916
- params: {
917
- format: 'regex'
918
- },
919
- message: 'should match format "regex"'
920
- };
921
- if (vErrors === null) vErrors = [err];
922
- else vErrors.push(err);
923
- errors++;
924
- }
925
- }
926
- }
927
- var valid2 = errors === errs_2;
928
- if (!valid2) {
929
- for (var i1 = startErrs1; i1 < errors; i1++) {
930
- vErrors[i1].propertyName = key1;
931
- }
932
- var err = {
933
- keyword: 'propertyNames',
934
- dataPath: (dataPath || '') + '.patternProperties',
935
- schemaPath: '#/properties/patternProperties/propertyNames',
936
- params: {
937
- propertyName: '' + key1 + ''
938
- },
939
- message: 'property name \'' + key1 + '\' is invalid'
940
- };
941
- if (vErrors === null) vErrors = [err];
942
- else vErrors.push(err);
943
- errors++;
944
- validate.errors = vErrors;
945
- return false;
946
- break;
947
- }
948
- }
949
- if (errs__1 == errors) {
950
- var errs__1 = errors;
951
- var valid2 = true;
952
- for (var key1 in data1) {
953
- var errs_2 = errors;
954
- if (!validate(data1[key1], (dataPath || '') + '.patternProperties[\'' + key1 + '\']', data1, key1, rootData)) {
955
- if (vErrors === null) vErrors = validate.errors;
956
- else vErrors = vErrors.concat(validate.errors);
957
- errors = vErrors.length;
958
- }
959
- var valid2 = errors === errs_2;
960
- if (!valid2) break;
961
- }
962
- }
963
- } else {
964
- validate.errors = [{
965
- keyword: 'type',
966
- dataPath: (dataPath || '') + '.patternProperties',
967
- schemaPath: '#/properties/patternProperties/type',
968
- params: {
969
- type: 'object'
970
- },
971
- message: 'should be object'
972
- }];
973
- return false;
974
- }
975
- var valid1 = errors === errs_1;
976
- }
977
- if (valid1) {
978
- var data1 = data.dependencies;
979
- if (data1 === undefined) {
980
- valid1 = true;
981
- } else {
982
- var errs_1 = errors;
983
- if ((data1 && typeof data1 === "object" && !Array.isArray(data1))) {
984
- var errs__1 = errors;
985
- var valid2 = true;
986
- for (var key1 in data1) {
987
- var data2 = data1[key1];
988
- var errs_2 = errors;
989
- var errs__2 = errors;
990
- var valid2 = false;
991
- var errs_3 = errors;
992
- if (!validate(data2, (dataPath || '') + '.dependencies[\'' + key1 + '\']', data1, key1, rootData)) {
993
- if (vErrors === null) vErrors = validate.errors;
994
- else vErrors = vErrors.concat(validate.errors);
995
- errors = vErrors.length;
996
- }
997
- var valid3 = errors === errs_3;
998
- valid2 = valid2 || valid3;
999
- if (!valid2) {
1000
- var errs_3 = errors;
1001
- var errs_4 = errors;
1002
- if (Array.isArray(data2)) {
1003
- var errs__4 = errors;
1004
- var valid4;
1005
- for (var i4 = 0; i4 < data2.length; i4++) {
1006
- var errs_5 = errors;
1007
- if (typeof data2[i4] !== "string") {
1008
- var err = {
1009
- keyword: 'type',
1010
- dataPath: (dataPath || '') + '.dependencies[\'' + key1 + '\'][' + i4 + ']',
1011
- schemaPath: '#/definitions/stringArray/items/type',
1012
- params: {
1013
- type: 'string'
1014
- },
1015
- message: 'should be string'
1016
- };
1017
- if (vErrors === null) vErrors = [err];
1018
- else vErrors.push(err);
1019
- errors++;
1020
- }
1021
- var valid5 = errors === errs_5;
1022
- if (!valid5) break;
1023
- }
1024
- if (errs__4 == errors) {
1025
- var i = data2.length,
1026
- valid4 = true,
1027
- j;
1028
- if (i > 1) {
1029
- var itemIndices = {},
1030
- item;
1031
- for (; i--;) {
1032
- var item = data2[i];
1033
- if (typeof item !== "string") continue;
1034
- if (typeof itemIndices[item] == 'number') {
1035
- valid4 = false;
1036
- j = itemIndices[item];
1037
- break;
1038
- }
1039
- itemIndices[item] = i;
1040
- }
1041
- }
1042
- if (!valid4) {
1043
- var err = {
1044
- keyword: 'uniqueItems',
1045
- dataPath: (dataPath || '') + '.dependencies[\'' + key1 + '\']',
1046
- schemaPath: '#/definitions/stringArray/uniqueItems',
1047
- params: {
1048
- i: i,
1049
- j: j
1050
- },
1051
- message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'
1052
- };
1053
- if (vErrors === null) vErrors = [err];
1054
- else vErrors.push(err);
1055
- errors++;
1056
- }
1057
- }
1058
- } else {
1059
- var err = {
1060
- keyword: 'type',
1061
- dataPath: (dataPath || '') + '.dependencies[\'' + key1 + '\']',
1062
- schemaPath: '#/definitions/stringArray/type',
1063
- params: {
1064
- type: 'array'
1065
- },
1066
- message: 'should be array'
1067
- };
1068
- if (vErrors === null) vErrors = [err];
1069
- else vErrors.push(err);
1070
- errors++;
1071
- }
1072
- var valid4 = errors === errs_4;
1073
- var valid3 = errors === errs_3;
1074
- valid2 = valid2 || valid3;
1075
- }
1076
- if (!valid2) {
1077
- var err = {
1078
- keyword: 'anyOf',
1079
- dataPath: (dataPath || '') + '.dependencies[\'' + key1 + '\']',
1080
- schemaPath: '#/properties/dependencies/additionalProperties/anyOf',
1081
- params: {},
1082
- message: 'should match some schema in anyOf'
1083
- };
1084
- if (vErrors === null) vErrors = [err];
1085
- else vErrors.push(err);
1086
- errors++;
1087
- validate.errors = vErrors;
1088
- return false;
1089
- } else {
1090
- errors = errs__2;
1091
- if (vErrors !== null) {
1092
- if (errs__2) vErrors.length = errs__2;
1093
- else vErrors = null;
1094
- }
1095
- }
1096
- var valid2 = errors === errs_2;
1097
- if (!valid2) break;
1098
- }
1099
- } else {
1100
- validate.errors = [{
1101
- keyword: 'type',
1102
- dataPath: (dataPath || '') + '.dependencies',
1103
- schemaPath: '#/properties/dependencies/type',
1104
- params: {
1105
- type: 'object'
1106
- },
1107
- message: 'should be object'
1108
- }];
1109
- return false;
1110
- }
1111
- var valid1 = errors === errs_1;
1112
- }
1113
- if (valid1) {
1114
- if (data.propertyNames === undefined) {
1115
- valid1 = true;
1116
- } else {
1117
- var errs_1 = errors;
1118
- if (!validate(data.propertyNames, (dataPath || '') + '.propertyNames', data, 'propertyNames', rootData)) {
1119
- if (vErrors === null) vErrors = validate.errors;
1120
- else vErrors = vErrors.concat(validate.errors);
1121
- errors = vErrors.length;
1122
- }
1123
- var valid1 = errors === errs_1;
1124
- }
1125
- if (valid1) {
1126
- if (valid1) {
1127
- var data1 = data.enum;
1128
- if (data1 === undefined) {
1129
- valid1 = true;
1130
- } else {
1131
- var errs_1 = errors;
1132
- if (Array.isArray(data1)) {
1133
- if (data1.length < 1) {
1134
- validate.errors = [{
1135
- keyword: 'minItems',
1136
- dataPath: (dataPath || '') + '.enum',
1137
- schemaPath: '#/properties/enum/minItems',
1138
- params: {
1139
- limit: 1
1140
- },
1141
- message: 'should NOT have fewer than 1 items'
1142
- }];
1143
- return false;
1144
- } else {
1145
- var errs__1 = errors;
1146
- var valid1;
1147
- if (errs__1 == errors) {
1148
- var i = data1.length,
1149
- valid1 = true,
1150
- j;
1151
- if (i > 1) {
1152
- outer: for (; i--;) {
1153
- for (j = i; j--;) {
1154
- if (equal(data1[i], data1[j])) {
1155
- valid1 = false;
1156
- break outer;
1157
- }
1158
- }
1159
- }
1160
- }
1161
- if (!valid1) {
1162
- validate.errors = [{
1163
- keyword: 'uniqueItems',
1164
- dataPath: (dataPath || '') + '.enum',
1165
- schemaPath: '#/properties/enum/uniqueItems',
1166
- params: {
1167
- i: i,
1168
- j: j
1169
- },
1170
- message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'
1171
- }];
1172
- return false;
1173
- }
1174
- }
1175
- }
1176
- } else {
1177
- validate.errors = [{
1178
- keyword: 'type',
1179
- dataPath: (dataPath || '') + '.enum',
1180
- schemaPath: '#/properties/enum/type',
1181
- params: {
1182
- type: 'array'
1183
- },
1184
- message: 'should be array'
1185
- }];
1186
- return false;
1187
- }
1188
- var valid1 = errors === errs_1;
1189
- }
1190
- if (valid1) {
1191
- var data1 = data.type;
1192
- if (data1 === undefined) {
1193
- valid1 = true;
1194
- } else {
1195
- var errs_1 = errors;
1196
- var errs__1 = errors;
1197
- var valid1 = false;
1198
- var errs_2 = errors;
1199
- var errs_3 = errors;
1200
- var schema3 = refVal5.enum;
1201
- var valid3;
1202
- valid3 = false;
1203
- for (var i3 = 0; i3 < schema3.length; i3++)
1204
- if (equal(data1, schema3[i3])) {
1205
- valid3 = true;
1206
- break;
1207
- } if (!valid3) {
1208
- var err = {
1209
- keyword: 'enum',
1210
- dataPath: (dataPath || '') + '.type',
1211
- schemaPath: '#/definitions/simpleTypes/enum',
1212
- params: {
1213
- allowedValues: schema3
1214
- },
1215
- message: 'should be equal to one of the allowed values'
1216
- };
1217
- if (vErrors === null) vErrors = [err];
1218
- else vErrors.push(err);
1219
- errors++;
1220
- }
1221
- var valid3 = errors === errs_3;
1222
- var valid2 = errors === errs_2;
1223
- valid1 = valid1 || valid2;
1224
- if (!valid1) {
1225
- var errs_2 = errors;
1226
- if (Array.isArray(data1)) {
1227
- if (data1.length < 1) {
1228
- var err = {
1229
- keyword: 'minItems',
1230
- dataPath: (dataPath || '') + '.type',
1231
- schemaPath: '#/properties/type/anyOf/1/minItems',
1232
- params: {
1233
- limit: 1
1234
- },
1235
- message: 'should NOT have fewer than 1 items'
1236
- };
1237
- if (vErrors === null) vErrors = [err];
1238
- else vErrors.push(err);
1239
- errors++;
1240
- } else {
1241
- var errs__2 = errors;
1242
- var valid2;
1243
- for (var i2 = 0; i2 < data1.length; i2++) {
1244
- var errs_3 = errors;
1245
- var errs_4 = errors;
1246
- var schema4 = refVal[5].enum;
1247
- var valid4;
1248
- valid4 = false;
1249
- for (var i4 = 0; i4 < schema4.length; i4++)
1250
- if (equal(data1[i2], schema4[i4])) {
1251
- valid4 = true;
1252
- break;
1253
- } if (!valid4) {
1254
- var err = {
1255
- keyword: 'enum',
1256
- dataPath: (dataPath || '') + '.type[' + i2 + ']',
1257
- schemaPath: '#/definitions/simpleTypes/enum',
1258
- params: {
1259
- allowedValues: schema4
1260
- },
1261
- message: 'should be equal to one of the allowed values'
1262
- };
1263
- if (vErrors === null) vErrors = [err];
1264
- else vErrors.push(err);
1265
- errors++;
1266
- }
1267
- var valid4 = errors === errs_4;
1268
- var valid3 = errors === errs_3;
1269
- if (!valid3) break;
1270
- }
1271
- if (errs__2 == errors) {
1272
- var i = data1.length,
1273
- valid2 = true,
1274
- j;
1275
- if (i > 1) {
1276
- outer: for (; i--;) {
1277
- for (j = i; j--;) {
1278
- if (equal(data1[i], data1[j])) {
1279
- valid2 = false;
1280
- break outer;
1281
- }
1282
- }
1283
- }
1284
- }
1285
- if (!valid2) {
1286
- var err = {
1287
- keyword: 'uniqueItems',
1288
- dataPath: (dataPath || '') + '.type',
1289
- schemaPath: '#/properties/type/anyOf/1/uniqueItems',
1290
- params: {
1291
- i: i,
1292
- j: j
1293
- },
1294
- message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'
1295
- };
1296
- if (vErrors === null) vErrors = [err];
1297
- else vErrors.push(err);
1298
- errors++;
1299
- }
1300
- }
1301
- }
1302
- } else {
1303
- var err = {
1304
- keyword: 'type',
1305
- dataPath: (dataPath || '') + '.type',
1306
- schemaPath: '#/properties/type/anyOf/1/type',
1307
- params: {
1308
- type: 'array'
1309
- },
1310
- message: 'should be array'
1311
- };
1312
- if (vErrors === null) vErrors = [err];
1313
- else vErrors.push(err);
1314
- errors++;
1315
- }
1316
- var valid2 = errors === errs_2;
1317
- valid1 = valid1 || valid2;
1318
- }
1319
- if (!valid1) {
1320
- var err = {
1321
- keyword: 'anyOf',
1322
- dataPath: (dataPath || '') + '.type',
1323
- schemaPath: '#/properties/type/anyOf',
1324
- params: {},
1325
- message: 'should match some schema in anyOf'
1326
- };
1327
- if (vErrors === null) vErrors = [err];
1328
- else vErrors.push(err);
1329
- errors++;
1330
- validate.errors = vErrors;
1331
- return false;
1332
- } else {
1333
- errors = errs__1;
1334
- if (vErrors !== null) {
1335
- if (errs__1) vErrors.length = errs__1;
1336
- else vErrors = null;
1337
- }
1338
- }
1339
- var valid1 = errors === errs_1;
1340
- }
1341
- if (valid1) {
1342
- if (data.format === undefined) {
1343
- valid1 = true;
1344
- } else {
1345
- var errs_1 = errors;
1346
- if (typeof data.format !== "string") {
1347
- validate.errors = [{
1348
- keyword: 'type',
1349
- dataPath: (dataPath || '') + '.format',
1350
- schemaPath: '#/properties/format/type',
1351
- params: {
1352
- type: 'string'
1353
- },
1354
- message: 'should be string'
1355
- }];
1356
- return false;
1357
- }
1358
- var valid1 = errors === errs_1;
1359
- }
1360
- if (valid1) {
1361
- if (data.contentMediaType === undefined) {
1362
- valid1 = true;
1363
- } else {
1364
- var errs_1 = errors;
1365
- if (typeof data.contentMediaType !== "string") {
1366
- validate.errors = [{
1367
- keyword: 'type',
1368
- dataPath: (dataPath || '') + '.contentMediaType',
1369
- schemaPath: '#/properties/contentMediaType/type',
1370
- params: {
1371
- type: 'string'
1372
- },
1373
- message: 'should be string'
1374
- }];
1375
- return false;
1376
- }
1377
- var valid1 = errors === errs_1;
1378
- }
1379
- if (valid1) {
1380
- if (data.contentEncoding === undefined) {
1381
- valid1 = true;
1382
- } else {
1383
- var errs_1 = errors;
1384
- if (typeof data.contentEncoding !== "string") {
1385
- validate.errors = [{
1386
- keyword: 'type',
1387
- dataPath: (dataPath || '') + '.contentEncoding',
1388
- schemaPath: '#/properties/contentEncoding/type',
1389
- params: {
1390
- type: 'string'
1391
- },
1392
- message: 'should be string'
1393
- }];
1394
- return false;
1395
- }
1396
- var valid1 = errors === errs_1;
1397
- }
1398
- if (valid1) {
1399
- if (data.if === undefined) {
1400
- valid1 = true;
1401
- } else {
1402
- var errs_1 = errors;
1403
- if (!validate(data.if, (dataPath || '') + '.if', data, 'if', rootData)) {
1404
- if (vErrors === null) vErrors = validate.errors;
1405
- else vErrors = vErrors.concat(validate.errors);
1406
- errors = vErrors.length;
1407
- }
1408
- var valid1 = errors === errs_1;
1409
- }
1410
- if (valid1) {
1411
- if (data.then === undefined) {
1412
- valid1 = true;
1413
- } else {
1414
- var errs_1 = errors;
1415
- if (!validate(data.then, (dataPath || '') + '.then', data, 'then', rootData)) {
1416
- if (vErrors === null) vErrors = validate.errors;
1417
- else vErrors = vErrors.concat(validate.errors);
1418
- errors = vErrors.length;
1419
- }
1420
- var valid1 = errors === errs_1;
1421
- }
1422
- if (valid1) {
1423
- if (data.else === undefined) {
1424
- valid1 = true;
1425
- } else {
1426
- var errs_1 = errors;
1427
- if (!validate(data.else, (dataPath || '') + '.else', data, 'else', rootData)) {
1428
- if (vErrors === null) vErrors = validate.errors;
1429
- else vErrors = vErrors.concat(validate.errors);
1430
- errors = vErrors.length;
1431
- }
1432
- var valid1 = errors === errs_1;
1433
- }
1434
- if (valid1) {
1435
- if (data.allOf === undefined) {
1436
- valid1 = true;
1437
- } else {
1438
- var errs_1 = errors;
1439
- if (!refVal[3](data.allOf, (dataPath || '') + '.allOf', data, 'allOf', rootData)) {
1440
- if (vErrors === null) vErrors = refVal[3].errors;
1441
- else vErrors = vErrors.concat(refVal[3].errors);
1442
- errors = vErrors.length;
1443
- }
1444
- var valid1 = errors === errs_1;
1445
- }
1446
- if (valid1) {
1447
- if (data.anyOf === undefined) {
1448
- valid1 = true;
1449
- } else {
1450
- var errs_1 = errors;
1451
- if (!refVal[3](data.anyOf, (dataPath || '') + '.anyOf', data, 'anyOf', rootData)) {
1452
- if (vErrors === null) vErrors = refVal[3].errors;
1453
- else vErrors = vErrors.concat(refVal[3].errors);
1454
- errors = vErrors.length;
1455
- }
1456
- var valid1 = errors === errs_1;
1457
- }
1458
- if (valid1) {
1459
- if (data.oneOf === undefined) {
1460
- valid1 = true;
1461
- } else {
1462
- var errs_1 = errors;
1463
- if (!refVal[3](data.oneOf, (dataPath || '') + '.oneOf', data, 'oneOf', rootData)) {
1464
- if (vErrors === null) vErrors = refVal[3].errors;
1465
- else vErrors = vErrors.concat(refVal[3].errors);
1466
- errors = vErrors.length;
1467
- }
1468
- var valid1 = errors === errs_1;
1469
- }
1470
- if (valid1) {
1471
- if (data.not === undefined) {
1472
- valid1 = true;
1473
- } else {
1474
- var errs_1 = errors;
1475
- if (!validate(data.not, (dataPath || '') + '.not', data, 'not', rootData)) {
1476
- if (vErrors === null) vErrors = validate.errors;
1477
- else vErrors = vErrors.concat(validate.errors);
1478
- errors = vErrors.length;
1479
- }
1480
- var valid1 = errors === errs_1;
1481
- }
1482
- }
1483
- }
1484
- }
1485
- }
1486
- }
1487
- }
1488
- }
1489
- }
1490
- }
1491
- }
1492
- }
1493
- }
1494
- }
1495
- }
1496
- }
1497
- }
1498
- }
1499
- }
1500
- }
1501
- }
1502
- }
1503
- }
1504
- }
1505
- }
1506
- }
1507
- }
1508
- }
1509
- }
1510
- }
1511
- }
1512
- }
1513
- }
1514
- }
1515
- }
1516
- }
1517
- }
1518
- }
1519
- }
1520
- }
1521
- }
1522
- }
1523
- }
1524
- }
1525
- }
1526
- }
1527
- validate.errors = vErrors;
1528
- return errors === 0;
1529
- };
1530
- })();
1531
- validate.schema = {
1532
- "$schema": "http://json-schema.org/draft-07/schema#",
1533
- "$id": "http://json-schema.org/draft-07/schema#",
1534
- "title": "Core schema meta-schema",
1535
- "definitions": {
1536
- "schemaArray": {
1537
- "type": "array",
1538
- "minItems": 1,
1539
- "items": {
1540
- "$ref": "#"
1541
- }
1542
- },
1543
- "nonNegativeInteger": {
1544
- "type": "integer",
1545
- "minimum": 0
1546
- },
1547
- "nonNegativeIntegerDefault0": {
1548
- "allOf": [{
1549
- "$ref": "#/definitions/nonNegativeInteger"
1550
- }, {
1551
- "default": 0
1552
- }]
1553
- },
1554
- "simpleTypes": {
1555
- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
1556
- },
1557
- "stringArray": {
1558
- "type": "array",
1559
- "items": {
1560
- "type": "string"
1561
- },
1562
- "uniqueItems": true,
1563
- "default": []
1564
- }
1565
- },
1566
- "type": ["object", "boolean"],
1567
- "properties": {
1568
- "$id": {
1569
- "type": "string",
1570
- "format": "uri-reference"
1571
- },
1572
- "$schema": {
1573
- "type": "string",
1574
- "format": "uri"
1575
- },
1576
- "$ref": {
1577
- "type": "string",
1578
- "format": "uri-reference"
1579
- },
1580
- "$comment": {
1581
- "type": "string"
1582
- },
1583
- "title": {
1584
- "type": "string"
1585
- },
1586
- "description": {
1587
- "type": "string"
1588
- },
1589
- "default": true,
1590
- "readOnly": {
1591
- "type": "boolean",
1592
- "default": false
1593
- },
1594
- "examples": {
1595
- "type": "array",
1596
- "items": true
1597
- },
1598
- "multipleOf": {
1599
- "type": "number",
1600
- "exclusiveMinimum": 0
1601
- },
1602
- "maximum": {
1603
- "type": "number"
1604
- },
1605
- "exclusiveMaximum": {
1606
- "type": "number"
1607
- },
1608
- "minimum": {
1609
- "type": "number"
1610
- },
1611
- "exclusiveMinimum": {
1612
- "type": "number"
1613
- },
1614
- "maxLength": {
1615
- "$ref": "#/definitions/nonNegativeInteger"
1616
- },
1617
- "minLength": {
1618
- "$ref": "#/definitions/nonNegativeIntegerDefault0"
1619
- },
1620
- "pattern": {
1621
- "type": "string",
1622
- "format": "regex"
1623
- },
1624
- "additionalItems": {
1625
- "$ref": "#"
1626
- },
1627
- "items": {
1628
- "anyOf": [{
1629
- "$ref": "#"
1630
- }, {
1631
- "$ref": "#/definitions/schemaArray"
1632
- }],
1633
- "default": true
1634
- },
1635
- "maxItems": {
1636
- "$ref": "#/definitions/nonNegativeInteger"
1637
- },
1638
- "minItems": {
1639
- "$ref": "#/definitions/nonNegativeIntegerDefault0"
1640
- },
1641
- "uniqueItems": {
1642
- "type": "boolean",
1643
- "default": false
1644
- },
1645
- "contains": {
1646
- "$ref": "#"
1647
- },
1648
- "maxProperties": {
1649
- "$ref": "#/definitions/nonNegativeInteger"
1650
- },
1651
- "minProperties": {
1652
- "$ref": "#/definitions/nonNegativeIntegerDefault0"
1653
- },
1654
- "required": {
1655
- "$ref": "#/definitions/stringArray"
1656
- },
1657
- "additionalProperties": {
1658
- "$ref": "#"
1659
- },
1660
- "definitions": {
1661
- "type": "object",
1662
- "additionalProperties": {
1663
- "$ref": "#"
1664
- },
1665
- "default": {}
1666
- },
1667
- "properties": {
1668
- "type": "object",
1669
- "additionalProperties": {
1670
- "$ref": "#"
1671
- },
1672
- "default": {}
1673
- },
1674
- "patternProperties": {
1675
- "type": "object",
1676
- "additionalProperties": {
1677
- "$ref": "#"
1678
- },
1679
- "propertyNames": {
1680
- "format": "regex"
1681
- },
1682
- "default": {}
1683
- },
1684
- "dependencies": {
1685
- "type": "object",
1686
- "additionalProperties": {
1687
- "anyOf": [{
1688
- "$ref": "#"
1689
- }, {
1690
- "$ref": "#/definitions/stringArray"
1691
- }]
1692
- }
1693
- },
1694
- "propertyNames": {
1695
- "$ref": "#"
1696
- },
1697
- "const": true,
1698
- "enum": {
1699
- "type": "array",
1700
- "items": true,
1701
- "minItems": 1,
1702
- "uniqueItems": true
1703
- },
1704
- "type": {
1705
- "anyOf": [{
1706
- "$ref": "#/definitions/simpleTypes"
1707
- }, {
1708
- "type": "array",
1709
- "items": {
1710
- "$ref": "#/definitions/simpleTypes"
1711
- },
1712
- "minItems": 1,
1713
- "uniqueItems": true
1714
- }]
1715
- },
1716
- "format": {
1717
- "type": "string"
1718
- },
1719
- "contentMediaType": {
1720
- "type": "string"
1721
- },
1722
- "contentEncoding": {
1723
- "type": "string"
1724
- },
1725
- "if": {
1726
- "$ref": "#"
1727
- },
1728
- "then": {
1729
- "$ref": "#"
1730
- },
1731
- "else": {
1732
- "$ref": "#"
1733
- },
1734
- "allOf": {
1735
- "$ref": "#/definitions/schemaArray"
1736
- },
1737
- "anyOf": {
1738
- "$ref": "#/definitions/schemaArray"
1739
- },
1740
- "oneOf": {
1741
- "$ref": "#/definitions/schemaArray"
1742
- },
1743
- "not": {
1744
- "$ref": "#"
1745
- }
1746
- },
1747
- "default": true
1748
- };
1749
- validate.errors = null;
1750
- module.exports = validate;
34
+ const schema15 = {"type":"array","minItems":1,"items":{"$ref":"#"}};
35
+ const root1 = {validate: validate10};
36
+
37
+ function validate13(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
38
+ let vErrors = null;
39
+ let errors = 0;
40
+ if(errors === 0){
41
+ if(Array.isArray(data)){
42
+ if(data.length < 1){
43
+ validate13.errors = [{instancePath,schemaPath:"#/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"}];
44
+ return false;
45
+ }
46
+ else {
47
+ var valid0 = true;
48
+ const len0 = data.length;
49
+ for(let i0=0; i0<len0; i0++){
50
+ const _errs1 = errors;
51
+ if(!(root1.validate(data[i0], {instancePath:instancePath+"/" + i0,parentData:data,parentDataProperty:i0,rootData}))){
52
+ vErrors = vErrors === null ? root1.validate.errors : vErrors.concat(root1.validate.errors);
53
+ errors = vErrors.length;
54
+ }
55
+ var valid0 = _errs1 === errors;
56
+ if(!valid0){
57
+ break;
58
+ }
59
+ }
60
+ }
61
+ }
62
+ else {
63
+ validate13.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "array"},message:"must be array"}];
64
+ return false;
65
+ }
66
+ }
67
+ validate13.errors = vErrors;
68
+ return errors === 0;
69
+ }
70
+
71
+ const func0 = require("ajv/dist/runtime/equal").default;
72
+
73
+ function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
74
+ /*# sourceURL="http://json-schema.org/draft-07/schema#" */;
75
+ let vErrors = null;
76
+ let errors = 0;
77
+ if((!(data && typeof data == "object" && !Array.isArray(data))) && (typeof data !== "boolean")){
78
+ validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: schema11.type},message:"must be object,boolean"}];
79
+ return false;
80
+ }
81
+ if(errors === 0){
82
+ if(data && typeof data == "object" && !Array.isArray(data)){
83
+ if(data.$id !== undefined){
84
+ let data0 = data.$id;
85
+ const _errs1 = errors;
86
+ if(errors === _errs1){
87
+ if(errors === _errs1){
88
+ if(typeof data0 === "string"){
89
+ if(!(formats0.test(data0))){
90
+ validate10.errors = [{instancePath:instancePath+"/$id",schemaPath:"#/properties/%24id/format",keyword:"format",params:{format: "uri-reference"},message:"must match format \""+"uri-reference"+"\""}];
91
+ return false;
92
+ }
93
+ }
94
+ else {
95
+ validate10.errors = [{instancePath:instancePath+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type: "string"},message:"must be string"}];
96
+ return false;
97
+ }
98
+ }
99
+ }
100
+ var valid0 = _errs1 === errors;
101
+ }
102
+ else {
103
+ var valid0 = true;
104
+ }
105
+ if(valid0){
106
+ if(data.$schema !== undefined){
107
+ let data1 = data.$schema;
108
+ const _errs3 = errors;
109
+ if(errors === _errs3){
110
+ if(errors === _errs3){
111
+ if(typeof data1 === "string"){
112
+ if(!(formats2(data1))){
113
+ validate10.errors = [{instancePath:instancePath+"/$schema",schemaPath:"#/properties/%24schema/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\""}];
114
+ return false;
115
+ }
116
+ }
117
+ else {
118
+ validate10.errors = [{instancePath:instancePath+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type: "string"},message:"must be string"}];
119
+ return false;
120
+ }
121
+ }
122
+ }
123
+ var valid0 = _errs3 === errors;
124
+ }
125
+ else {
126
+ var valid0 = true;
127
+ }
128
+ if(valid0){
129
+ if(data.$ref !== undefined){
130
+ let data2 = data.$ref;
131
+ const _errs5 = errors;
132
+ if(errors === _errs5){
133
+ if(errors === _errs5){
134
+ if(typeof data2 === "string"){
135
+ if(!(formats0.test(data2))){
136
+ validate10.errors = [{instancePath:instancePath+"/$ref",schemaPath:"#/properties/%24ref/format",keyword:"format",params:{format: "uri-reference"},message:"must match format \""+"uri-reference"+"\""}];
137
+ return false;
138
+ }
139
+ }
140
+ else {
141
+ validate10.errors = [{instancePath:instancePath+"/$ref",schemaPath:"#/properties/%24ref/type",keyword:"type",params:{type: "string"},message:"must be string"}];
142
+ return false;
143
+ }
144
+ }
145
+ }
146
+ var valid0 = _errs5 === errors;
147
+ }
148
+ else {
149
+ var valid0 = true;
150
+ }
151
+ if(valid0){
152
+ if(data.$comment !== undefined){
153
+ const _errs7 = errors;
154
+ if(typeof data.$comment !== "string"){
155
+ validate10.errors = [{instancePath:instancePath+"/$comment",schemaPath:"#/properties/%24comment/type",keyword:"type",params:{type: "string"},message:"must be string"}];
156
+ return false;
157
+ }
158
+ var valid0 = _errs7 === errors;
159
+ }
160
+ else {
161
+ var valid0 = true;
162
+ }
163
+ if(valid0){
164
+ if(data.title !== undefined){
165
+ const _errs9 = errors;
166
+ if(typeof data.title !== "string"){
167
+ validate10.errors = [{instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"}];
168
+ return false;
169
+ }
170
+ var valid0 = _errs9 === errors;
171
+ }
172
+ else {
173
+ var valid0 = true;
174
+ }
175
+ if(valid0){
176
+ if(data.description !== undefined){
177
+ const _errs11 = errors;
178
+ if(typeof data.description !== "string"){
179
+ validate10.errors = [{instancePath:instancePath+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type: "string"},message:"must be string"}];
180
+ return false;
181
+ }
182
+ var valid0 = _errs11 === errors;
183
+ }
184
+ else {
185
+ var valid0 = true;
186
+ }
187
+ if(valid0){
188
+ if(data.readOnly !== undefined){
189
+ const _errs13 = errors;
190
+ if(typeof data.readOnly !== "boolean"){
191
+ validate10.errors = [{instancePath:instancePath+"/readOnly",schemaPath:"#/properties/readOnly/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
192
+ return false;
193
+ }
194
+ var valid0 = _errs13 === errors;
195
+ }
196
+ else {
197
+ var valid0 = true;
198
+ }
199
+ if(valid0){
200
+ if(data.examples !== undefined){
201
+ const _errs15 = errors;
202
+ if(errors === _errs15){
203
+ if(!(Array.isArray(data.examples))){
204
+ validate10.errors = [{instancePath:instancePath+"/examples",schemaPath:"#/properties/examples/type",keyword:"type",params:{type: "array"},message:"must be array"}];
205
+ return false;
206
+ }
207
+ }
208
+ var valid0 = _errs15 === errors;
209
+ }
210
+ else {
211
+ var valid0 = true;
212
+ }
213
+ if(valid0){
214
+ if(data.multipleOf !== undefined){
215
+ let data8 = data.multipleOf;
216
+ const _errs17 = errors;
217
+ if(errors === _errs17){
218
+ if((typeof data8 == "number") && (isFinite(data8))){
219
+ if(data8 <= 0 || isNaN(data8)){
220
+ validate10.errors = [{instancePath:instancePath+"/multipleOf",schemaPath:"#/properties/multipleOf/exclusiveMinimum",keyword:"exclusiveMinimum",params:{comparison: ">", limit: 0},message:"must be > 0"}];
221
+ return false;
222
+ }
223
+ }
224
+ else {
225
+ validate10.errors = [{instancePath:instancePath+"/multipleOf",schemaPath:"#/properties/multipleOf/type",keyword:"type",params:{type: "number"},message:"must be number"}];
226
+ return false;
227
+ }
228
+ }
229
+ var valid0 = _errs17 === errors;
230
+ }
231
+ else {
232
+ var valid0 = true;
233
+ }
234
+ if(valid0){
235
+ if(data.maximum !== undefined){
236
+ let data9 = data.maximum;
237
+ const _errs19 = errors;
238
+ if(!((typeof data9 == "number") && (isFinite(data9)))){
239
+ validate10.errors = [{instancePath:instancePath+"/maximum",schemaPath:"#/properties/maximum/type",keyword:"type",params:{type: "number"},message:"must be number"}];
240
+ return false;
241
+ }
242
+ var valid0 = _errs19 === errors;
243
+ }
244
+ else {
245
+ var valid0 = true;
246
+ }
247
+ if(valid0){
248
+ if(data.exclusiveMaximum !== undefined){
249
+ let data10 = data.exclusiveMaximum;
250
+ const _errs21 = errors;
251
+ if(!((typeof data10 == "number") && (isFinite(data10)))){
252
+ validate10.errors = [{instancePath:instancePath+"/exclusiveMaximum",schemaPath:"#/properties/exclusiveMaximum/type",keyword:"type",params:{type: "number"},message:"must be number"}];
253
+ return false;
254
+ }
255
+ var valid0 = _errs21 === errors;
256
+ }
257
+ else {
258
+ var valid0 = true;
259
+ }
260
+ if(valid0){
261
+ if(data.minimum !== undefined){
262
+ let data11 = data.minimum;
263
+ const _errs23 = errors;
264
+ if(!((typeof data11 == "number") && (isFinite(data11)))){
265
+ validate10.errors = [{instancePath:instancePath+"/minimum",schemaPath:"#/properties/minimum/type",keyword:"type",params:{type: "number"},message:"must be number"}];
266
+ return false;
267
+ }
268
+ var valid0 = _errs23 === errors;
269
+ }
270
+ else {
271
+ var valid0 = true;
272
+ }
273
+ if(valid0){
274
+ if(data.exclusiveMinimum !== undefined){
275
+ let data12 = data.exclusiveMinimum;
276
+ const _errs25 = errors;
277
+ if(!((typeof data12 == "number") && (isFinite(data12)))){
278
+ validate10.errors = [{instancePath:instancePath+"/exclusiveMinimum",schemaPath:"#/properties/exclusiveMinimum/type",keyword:"type",params:{type: "number"},message:"must be number"}];
279
+ return false;
280
+ }
281
+ var valid0 = _errs25 === errors;
282
+ }
283
+ else {
284
+ var valid0 = true;
285
+ }
286
+ if(valid0){
287
+ if(data.maxLength !== undefined){
288
+ let data13 = data.maxLength;
289
+ const _errs27 = errors;
290
+ const _errs28 = errors;
291
+ if(!(((typeof data13 == "number") && (!(data13 % 1) && !isNaN(data13))) && (isFinite(data13)))){
292
+ validate10.errors = [{instancePath:instancePath+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
293
+ return false;
294
+ }
295
+ if(errors === _errs28){
296
+ if((typeof data13 == "number") && (isFinite(data13))){
297
+ if(data13 < 0 || isNaN(data13)){
298
+ validate10.errors = [{instancePath:instancePath+"/maxLength",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];
299
+ return false;
300
+ }
301
+ }
302
+ }
303
+ var valid0 = _errs27 === errors;
304
+ }
305
+ else {
306
+ var valid0 = true;
307
+ }
308
+ if(valid0){
309
+ if(data.minLength !== undefined){
310
+ const _errs30 = errors;
311
+ if(!(validate11(data.minLength, {instancePath:instancePath+"/minLength",parentData:data,parentDataProperty:"minLength",rootData}))){
312
+ vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
313
+ errors = vErrors.length;
314
+ }
315
+ var valid0 = _errs30 === errors;
316
+ }
317
+ else {
318
+ var valid0 = true;
319
+ }
320
+ if(valid0){
321
+ if(data.pattern !== undefined){
322
+ let data15 = data.pattern;
323
+ const _errs31 = errors;
324
+ if(errors === _errs31){
325
+ if(errors === _errs31){
326
+ if(typeof data15 === "string"){
327
+ if(!(formats6(data15))){
328
+ validate10.errors = [{instancePath:instancePath+"/pattern",schemaPath:"#/properties/pattern/format",keyword:"format",params:{format: "regex"},message:"must match format \""+"regex"+"\""}];
329
+ return false;
330
+ }
331
+ }
332
+ else {
333
+ validate10.errors = [{instancePath:instancePath+"/pattern",schemaPath:"#/properties/pattern/type",keyword:"type",params:{type: "string"},message:"must be string"}];
334
+ return false;
335
+ }
336
+ }
337
+ }
338
+ var valid0 = _errs31 === errors;
339
+ }
340
+ else {
341
+ var valid0 = true;
342
+ }
343
+ if(valid0){
344
+ if(data.additionalItems !== undefined){
345
+ const _errs33 = errors;
346
+ if(!(validate10(data.additionalItems, {instancePath:instancePath+"/additionalItems",parentData:data,parentDataProperty:"additionalItems",rootData}))){
347
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
348
+ errors = vErrors.length;
349
+ }
350
+ var valid0 = _errs33 === errors;
351
+ }
352
+ else {
353
+ var valid0 = true;
354
+ }
355
+ if(valid0){
356
+ if(data.items !== undefined){
357
+ let data17 = data.items;
358
+ const _errs34 = errors;
359
+ const _errs35 = errors;
360
+ let valid2 = false;
361
+ const _errs36 = errors;
362
+ if(!(validate10(data17, {instancePath:instancePath+"/items",parentData:data,parentDataProperty:"items",rootData}))){
363
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
364
+ errors = vErrors.length;
365
+ }
366
+ var _valid0 = _errs36 === errors;
367
+ valid2 = valid2 || _valid0;
368
+ if(!valid2){
369
+ const _errs37 = errors;
370
+ if(!(validate13(data17, {instancePath:instancePath+"/items",parentData:data,parentDataProperty:"items",rootData}))){
371
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
372
+ errors = vErrors.length;
373
+ }
374
+ var _valid0 = _errs37 === errors;
375
+ valid2 = valid2 || _valid0;
376
+ }
377
+ if(!valid2){
378
+ const err0 = {instancePath:instancePath+"/items",schemaPath:"#/properties/items/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};
379
+ if(vErrors === null){
380
+ vErrors = [err0];
381
+ }
382
+ else {
383
+ vErrors.push(err0);
384
+ }
385
+ errors++;
386
+ validate10.errors = vErrors;
387
+ return false;
388
+ }
389
+ else {
390
+ errors = _errs35;
391
+ if(vErrors !== null){
392
+ if(_errs35){
393
+ vErrors.length = _errs35;
394
+ }
395
+ else {
396
+ vErrors = null;
397
+ }
398
+ }
399
+ }
400
+ var valid0 = _errs34 === errors;
401
+ }
402
+ else {
403
+ var valid0 = true;
404
+ }
405
+ if(valid0){
406
+ if(data.maxItems !== undefined){
407
+ let data18 = data.maxItems;
408
+ const _errs38 = errors;
409
+ const _errs39 = errors;
410
+ if(!(((typeof data18 == "number") && (!(data18 % 1) && !isNaN(data18))) && (isFinite(data18)))){
411
+ validate10.errors = [{instancePath:instancePath+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
412
+ return false;
413
+ }
414
+ if(errors === _errs39){
415
+ if((typeof data18 == "number") && (isFinite(data18))){
416
+ if(data18 < 0 || isNaN(data18)){
417
+ validate10.errors = [{instancePath:instancePath+"/maxItems",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];
418
+ return false;
419
+ }
420
+ }
421
+ }
422
+ var valid0 = _errs38 === errors;
423
+ }
424
+ else {
425
+ var valid0 = true;
426
+ }
427
+ if(valid0){
428
+ if(data.minItems !== undefined){
429
+ const _errs41 = errors;
430
+ if(!(validate11(data.minItems, {instancePath:instancePath+"/minItems",parentData:data,parentDataProperty:"minItems",rootData}))){
431
+ vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
432
+ errors = vErrors.length;
433
+ }
434
+ var valid0 = _errs41 === errors;
435
+ }
436
+ else {
437
+ var valid0 = true;
438
+ }
439
+ if(valid0){
440
+ if(data.uniqueItems !== undefined){
441
+ const _errs42 = errors;
442
+ if(typeof data.uniqueItems !== "boolean"){
443
+ validate10.errors = [{instancePath:instancePath+"/uniqueItems",schemaPath:"#/properties/uniqueItems/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
444
+ return false;
445
+ }
446
+ var valid0 = _errs42 === errors;
447
+ }
448
+ else {
449
+ var valid0 = true;
450
+ }
451
+ if(valid0){
452
+ if(data.contains !== undefined){
453
+ const _errs44 = errors;
454
+ if(!(validate10(data.contains, {instancePath:instancePath+"/contains",parentData:data,parentDataProperty:"contains",rootData}))){
455
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
456
+ errors = vErrors.length;
457
+ }
458
+ var valid0 = _errs44 === errors;
459
+ }
460
+ else {
461
+ var valid0 = true;
462
+ }
463
+ if(valid0){
464
+ if(data.maxProperties !== undefined){
465
+ let data22 = data.maxProperties;
466
+ const _errs45 = errors;
467
+ const _errs46 = errors;
468
+ if(!(((typeof data22 == "number") && (!(data22 % 1) && !isNaN(data22))) && (isFinite(data22)))){
469
+ validate10.errors = [{instancePath:instancePath+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
470
+ return false;
471
+ }
472
+ if(errors === _errs46){
473
+ if((typeof data22 == "number") && (isFinite(data22))){
474
+ if(data22 < 0 || isNaN(data22)){
475
+ validate10.errors = [{instancePath:instancePath+"/maxProperties",schemaPath:"#/definitions/nonNegativeInteger/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];
476
+ return false;
477
+ }
478
+ }
479
+ }
480
+ var valid0 = _errs45 === errors;
481
+ }
482
+ else {
483
+ var valid0 = true;
484
+ }
485
+ if(valid0){
486
+ if(data.minProperties !== undefined){
487
+ const _errs48 = errors;
488
+ if(!(validate11(data.minProperties, {instancePath:instancePath+"/minProperties",parentData:data,parentDataProperty:"minProperties",rootData}))){
489
+ vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
490
+ errors = vErrors.length;
491
+ }
492
+ var valid0 = _errs48 === errors;
493
+ }
494
+ else {
495
+ var valid0 = true;
496
+ }
497
+ if(valid0){
498
+ if(data.required !== undefined){
499
+ let data24 = data.required;
500
+ const _errs49 = errors;
501
+ const _errs50 = errors;
502
+ if(errors === _errs50){
503
+ if(Array.isArray(data24)){
504
+ var valid6 = true;
505
+ const len0 = data24.length;
506
+ for(let i0=0; i0<len0; i0++){
507
+ const _errs52 = errors;
508
+ if(typeof data24[i0] !== "string"){
509
+ validate10.errors = [{instancePath:instancePath+"/required/" + i0,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];
510
+ return false;
511
+ }
512
+ var valid6 = _errs52 === errors;
513
+ if(!valid6){
514
+ break;
515
+ }
516
+ }
517
+ if(valid6){
518
+ let i1 = data24.length;
519
+ let j0;
520
+ if(i1 > 1){
521
+ const indices0 = {};
522
+ for(;i1--;){
523
+ let item0 = data24[i1];
524
+ if(typeof item0 !== "string"){
525
+ continue;
526
+ }
527
+ if(typeof indices0[item0] == "number"){
528
+ j0 = indices0[item0];
529
+ validate10.errors = [{instancePath:instancePath+"/required",schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];
530
+ return false;
531
+ break;
532
+ }
533
+ indices0[item0] = i1;
534
+ }
535
+ }
536
+ }
537
+ }
538
+ else {
539
+ validate10.errors = [{instancePath:instancePath+"/required",schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type: "array"},message:"must be array"}];
540
+ return false;
541
+ }
542
+ }
543
+ var valid0 = _errs49 === errors;
544
+ }
545
+ else {
546
+ var valid0 = true;
547
+ }
548
+ if(valid0){
549
+ if(data.additionalProperties !== undefined){
550
+ const _errs54 = errors;
551
+ if(!(validate10(data.additionalProperties, {instancePath:instancePath+"/additionalProperties",parentData:data,parentDataProperty:"additionalProperties",rootData}))){
552
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
553
+ errors = vErrors.length;
554
+ }
555
+ var valid0 = _errs54 === errors;
556
+ }
557
+ else {
558
+ var valid0 = true;
559
+ }
560
+ if(valid0){
561
+ if(data.definitions !== undefined){
562
+ let data27 = data.definitions;
563
+ const _errs55 = errors;
564
+ if(errors === _errs55){
565
+ if(data27 && typeof data27 == "object" && !Array.isArray(data27)){
566
+ for(const key0 in data27){
567
+ const _errs58 = errors;
568
+ if(!(validate10(data27[key0], {instancePath:instancePath+"/definitions/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"),parentData:data27,parentDataProperty:key0,rootData}))){
569
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
570
+ errors = vErrors.length;
571
+ }
572
+ var valid8 = _errs58 === errors;
573
+ if(!valid8){
574
+ break;
575
+ }
576
+ }
577
+ }
578
+ else {
579
+ validate10.errors = [{instancePath:instancePath+"/definitions",schemaPath:"#/properties/definitions/type",keyword:"type",params:{type: "object"},message:"must be object"}];
580
+ return false;
581
+ }
582
+ }
583
+ var valid0 = _errs55 === errors;
584
+ }
585
+ else {
586
+ var valid0 = true;
587
+ }
588
+ if(valid0){
589
+ if(data.properties !== undefined){
590
+ let data29 = data.properties;
591
+ const _errs59 = errors;
592
+ if(errors === _errs59){
593
+ if(data29 && typeof data29 == "object" && !Array.isArray(data29)){
594
+ for(const key1 in data29){
595
+ const _errs62 = errors;
596
+ if(!(validate10(data29[key1], {instancePath:instancePath+"/properties/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),parentData:data29,parentDataProperty:key1,rootData}))){
597
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
598
+ errors = vErrors.length;
599
+ }
600
+ var valid9 = _errs62 === errors;
601
+ if(!valid9){
602
+ break;
603
+ }
604
+ }
605
+ }
606
+ else {
607
+ validate10.errors = [{instancePath:instancePath+"/properties",schemaPath:"#/properties/properties/type",keyword:"type",params:{type: "object"},message:"must be object"}];
608
+ return false;
609
+ }
610
+ }
611
+ var valid0 = _errs59 === errors;
612
+ }
613
+ else {
614
+ var valid0 = true;
615
+ }
616
+ if(valid0){
617
+ if(data.patternProperties !== undefined){
618
+ let data31 = data.patternProperties;
619
+ const _errs63 = errors;
620
+ if(errors === _errs63){
621
+ if(data31 && typeof data31 == "object" && !Array.isArray(data31)){
622
+ for(const key2 in data31){
623
+ const _errs65 = errors;
624
+ if(errors === _errs65){
625
+ if(typeof key2 === "string"){
626
+ if(!(formats6(key2))){
627
+ const err1 = {instancePath:instancePath+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames/format",keyword:"format",params:{format: "regex"},message:"must match format \""+"regex"+"\"",propertyName:key2};
628
+ if(vErrors === null){
629
+ vErrors = [err1];
630
+ }
631
+ else {
632
+ vErrors.push(err1);
633
+ }
634
+ errors++;
635
+ }
636
+ }
637
+ }
638
+ var valid10 = _errs65 === errors;
639
+ if(!valid10){
640
+ const err2 = {instancePath:instancePath+"/patternProperties",schemaPath:"#/properties/patternProperties/propertyNames",keyword:"propertyNames",params:{propertyName: key2},message:"property name must be valid"};
641
+ if(vErrors === null){
642
+ vErrors = [err2];
643
+ }
644
+ else {
645
+ vErrors.push(err2);
646
+ }
647
+ errors++;
648
+ validate10.errors = vErrors;
649
+ return false;
650
+ break;
651
+ }
652
+ }
653
+ if(valid10){
654
+ for(const key3 in data31){
655
+ const _errs67 = errors;
656
+ if(!(validate10(data31[key3], {instancePath:instancePath+"/patternProperties/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),parentData:data31,parentDataProperty:key3,rootData}))){
657
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
658
+ errors = vErrors.length;
659
+ }
660
+ var valid11 = _errs67 === errors;
661
+ if(!valid11){
662
+ break;
663
+ }
664
+ }
665
+ }
666
+ }
667
+ else {
668
+ validate10.errors = [{instancePath:instancePath+"/patternProperties",schemaPath:"#/properties/patternProperties/type",keyword:"type",params:{type: "object"},message:"must be object"}];
669
+ return false;
670
+ }
671
+ }
672
+ var valid0 = _errs63 === errors;
673
+ }
674
+ else {
675
+ var valid0 = true;
676
+ }
677
+ if(valid0){
678
+ if(data.dependencies !== undefined){
679
+ let data33 = data.dependencies;
680
+ const _errs68 = errors;
681
+ if(errors === _errs68){
682
+ if(data33 && typeof data33 == "object" && !Array.isArray(data33)){
683
+ for(const key4 in data33){
684
+ let data34 = data33[key4];
685
+ const _errs71 = errors;
686
+ const _errs72 = errors;
687
+ let valid13 = false;
688
+ const _errs73 = errors;
689
+ if(!(validate10(data34, {instancePath:instancePath+"/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),parentData:data33,parentDataProperty:key4,rootData}))){
690
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
691
+ errors = vErrors.length;
692
+ }
693
+ var _valid1 = _errs73 === errors;
694
+ valid13 = valid13 || _valid1;
695
+ if(!valid13){
696
+ const _errs74 = errors;
697
+ const _errs75 = errors;
698
+ if(errors === _errs75){
699
+ if(Array.isArray(data34)){
700
+ var valid15 = true;
701
+ const len1 = data34.length;
702
+ for(let i2=0; i2<len1; i2++){
703
+ const _errs77 = errors;
704
+ if(typeof data34[i2] !== "string"){
705
+ const err3 = {instancePath:instancePath+"/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i2,schemaPath:"#/definitions/stringArray/items/type",keyword:"type",params:{type: "string"},message:"must be string"};
706
+ if(vErrors === null){
707
+ vErrors = [err3];
708
+ }
709
+ else {
710
+ vErrors.push(err3);
711
+ }
712
+ errors++;
713
+ }
714
+ var valid15 = _errs77 === errors;
715
+ if(!valid15){
716
+ break;
717
+ }
718
+ }
719
+ if(valid15){
720
+ let i3 = data34.length;
721
+ let j1;
722
+ if(i3 > 1){
723
+ const indices1 = {};
724
+ for(;i3--;){
725
+ let item1 = data34[i3];
726
+ if(typeof item1 !== "string"){
727
+ continue;
728
+ }
729
+ if(typeof indices1[item1] == "number"){
730
+ j1 = indices1[item1];
731
+ const err4 = {instancePath:instancePath+"/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/stringArray/uniqueItems",keyword:"uniqueItems",params:{i: i3, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i3+" are identical)"};
732
+ if(vErrors === null){
733
+ vErrors = [err4];
734
+ }
735
+ else {
736
+ vErrors.push(err4);
737
+ }
738
+ errors++;
739
+ break;
740
+ }
741
+ indices1[item1] = i3;
742
+ }
743
+ }
744
+ }
745
+ }
746
+ else {
747
+ const err5 = {instancePath:instancePath+"/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/stringArray/type",keyword:"type",params:{type: "array"},message:"must be array"};
748
+ if(vErrors === null){
749
+ vErrors = [err5];
750
+ }
751
+ else {
752
+ vErrors.push(err5);
753
+ }
754
+ errors++;
755
+ }
756
+ }
757
+ var _valid1 = _errs74 === errors;
758
+ valid13 = valid13 || _valid1;
759
+ }
760
+ if(!valid13){
761
+ const err6 = {instancePath:instancePath+"/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/dependencies/additionalProperties/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};
762
+ if(vErrors === null){
763
+ vErrors = [err6];
764
+ }
765
+ else {
766
+ vErrors.push(err6);
767
+ }
768
+ errors++;
769
+ validate10.errors = vErrors;
770
+ return false;
771
+ }
772
+ else {
773
+ errors = _errs72;
774
+ if(vErrors !== null){
775
+ if(_errs72){
776
+ vErrors.length = _errs72;
777
+ }
778
+ else {
779
+ vErrors = null;
780
+ }
781
+ }
782
+ }
783
+ var valid12 = _errs71 === errors;
784
+ if(!valid12){
785
+ break;
786
+ }
787
+ }
788
+ }
789
+ else {
790
+ validate10.errors = [{instancePath:instancePath+"/dependencies",schemaPath:"#/properties/dependencies/type",keyword:"type",params:{type: "object"},message:"must be object"}];
791
+ return false;
792
+ }
793
+ }
794
+ var valid0 = _errs68 === errors;
795
+ }
796
+ else {
797
+ var valid0 = true;
798
+ }
799
+ if(valid0){
800
+ if(data.propertyNames !== undefined){
801
+ const _errs79 = errors;
802
+ if(!(validate10(data.propertyNames, {instancePath:instancePath+"/propertyNames",parentData:data,parentDataProperty:"propertyNames",rootData}))){
803
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
804
+ errors = vErrors.length;
805
+ }
806
+ var valid0 = _errs79 === errors;
807
+ }
808
+ else {
809
+ var valid0 = true;
810
+ }
811
+ if(valid0){
812
+ if(data.enum !== undefined){
813
+ let data37 = data.enum;
814
+ const _errs80 = errors;
815
+ if(errors === _errs80){
816
+ if(Array.isArray(data37)){
817
+ if(data37.length < 1){
818
+ validate10.errors = [{instancePath:instancePath+"/enum",schemaPath:"#/properties/enum/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"}];
819
+ return false;
820
+ }
821
+ else {
822
+ let i4 = data37.length;
823
+ let j2;
824
+ if(i4 > 1){
825
+ outer0:
826
+ for(;i4--;){
827
+ for(j2 = i4; j2--;){
828
+ if(func0(data37[i4], data37[j2])){
829
+ validate10.errors = [{instancePath:instancePath+"/enum",schemaPath:"#/properties/enum/uniqueItems",keyword:"uniqueItems",params:{i: i4, j: j2},message:"must NOT have duplicate items (items ## "+j2+" and "+i4+" are identical)"}];
830
+ return false;
831
+ break outer0;
832
+ }
833
+ }
834
+ }
835
+ }
836
+ }
837
+ }
838
+ else {
839
+ validate10.errors = [{instancePath:instancePath+"/enum",schemaPath:"#/properties/enum/type",keyword:"type",params:{type: "array"},message:"must be array"}];
840
+ return false;
841
+ }
842
+ }
843
+ var valid0 = _errs80 === errors;
844
+ }
845
+ else {
846
+ var valid0 = true;
847
+ }
848
+ if(valid0){
849
+ if(data.type !== undefined){
850
+ let data38 = data.type;
851
+ const _errs82 = errors;
852
+ const _errs83 = errors;
853
+ let valid18 = false;
854
+ const _errs84 = errors;
855
+ if(!(((((((data38 === "array") || (data38 === "boolean")) || (data38 === "integer")) || (data38 === "null")) || (data38 === "number")) || (data38 === "object")) || (data38 === "string"))){
856
+ const err7 = {instancePath:instancePath+"/type",schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues: schema20.enum},message:"must be equal to one of the allowed values"};
857
+ if(vErrors === null){
858
+ vErrors = [err7];
859
+ }
860
+ else {
861
+ vErrors.push(err7);
862
+ }
863
+ errors++;
864
+ }
865
+ var _valid2 = _errs84 === errors;
866
+ valid18 = valid18 || _valid2;
867
+ if(!valid18){
868
+ const _errs86 = errors;
869
+ if(errors === _errs86){
870
+ if(Array.isArray(data38)){
871
+ if(data38.length < 1){
872
+ const err8 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/1/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};
873
+ if(vErrors === null){
874
+ vErrors = [err8];
875
+ }
876
+ else {
877
+ vErrors.push(err8);
878
+ }
879
+ errors++;
880
+ }
881
+ else {
882
+ var valid20 = true;
883
+ const len2 = data38.length;
884
+ for(let i5=0; i5<len2; i5++){
885
+ let data39 = data38[i5];
886
+ const _errs88 = errors;
887
+ if(!(((((((data39 === "array") || (data39 === "boolean")) || (data39 === "integer")) || (data39 === "null")) || (data39 === "number")) || (data39 === "object")) || (data39 === "string"))){
888
+ const err9 = {instancePath:instancePath+"/type/" + i5,schemaPath:"#/definitions/simpleTypes/enum",keyword:"enum",params:{allowedValues: schema20.enum},message:"must be equal to one of the allowed values"};
889
+ if(vErrors === null){
890
+ vErrors = [err9];
891
+ }
892
+ else {
893
+ vErrors.push(err9);
894
+ }
895
+ errors++;
896
+ }
897
+ var valid20 = _errs88 === errors;
898
+ if(!valid20){
899
+ break;
900
+ }
901
+ }
902
+ if(valid20){
903
+ let i6 = data38.length;
904
+ let j3;
905
+ if(i6 > 1){
906
+ outer1:
907
+ for(;i6--;){
908
+ for(j3 = i6; j3--;){
909
+ if(func0(data38[i6], data38[j3])){
910
+ const err10 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/1/uniqueItems",keyword:"uniqueItems",params:{i: i6, j: j3},message:"must NOT have duplicate items (items ## "+j3+" and "+i6+" are identical)"};
911
+ if(vErrors === null){
912
+ vErrors = [err10];
913
+ }
914
+ else {
915
+ vErrors.push(err10);
916
+ }
917
+ errors++;
918
+ break outer1;
919
+ }
920
+ }
921
+ }
922
+ }
923
+ }
924
+ }
925
+ }
926
+ else {
927
+ const err11 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type: "array"},message:"must be array"};
928
+ if(vErrors === null){
929
+ vErrors = [err11];
930
+ }
931
+ else {
932
+ vErrors.push(err11);
933
+ }
934
+ errors++;
935
+ }
936
+ }
937
+ var _valid2 = _errs86 === errors;
938
+ valid18 = valid18 || _valid2;
939
+ }
940
+ if(!valid18){
941
+ const err12 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};
942
+ if(vErrors === null){
943
+ vErrors = [err12];
944
+ }
945
+ else {
946
+ vErrors.push(err12);
947
+ }
948
+ errors++;
949
+ validate10.errors = vErrors;
950
+ return false;
951
+ }
952
+ else {
953
+ errors = _errs83;
954
+ if(vErrors !== null){
955
+ if(_errs83){
956
+ vErrors.length = _errs83;
957
+ }
958
+ else {
959
+ vErrors = null;
960
+ }
961
+ }
962
+ }
963
+ var valid0 = _errs82 === errors;
964
+ }
965
+ else {
966
+ var valid0 = true;
967
+ }
968
+ if(valid0){
969
+ if(data.format !== undefined){
970
+ const _errs90 = errors;
971
+ if(typeof data.format !== "string"){
972
+ validate10.errors = [{instancePath:instancePath+"/format",schemaPath:"#/properties/format/type",keyword:"type",params:{type: "string"},message:"must be string"}];
973
+ return false;
974
+ }
975
+ var valid0 = _errs90 === errors;
976
+ }
977
+ else {
978
+ var valid0 = true;
979
+ }
980
+ if(valid0){
981
+ if(data.contentMediaType !== undefined){
982
+ const _errs92 = errors;
983
+ if(typeof data.contentMediaType !== "string"){
984
+ validate10.errors = [{instancePath:instancePath+"/contentMediaType",schemaPath:"#/properties/contentMediaType/type",keyword:"type",params:{type: "string"},message:"must be string"}];
985
+ return false;
986
+ }
987
+ var valid0 = _errs92 === errors;
988
+ }
989
+ else {
990
+ var valid0 = true;
991
+ }
992
+ if(valid0){
993
+ if(data.contentEncoding !== undefined){
994
+ const _errs94 = errors;
995
+ if(typeof data.contentEncoding !== "string"){
996
+ validate10.errors = [{instancePath:instancePath+"/contentEncoding",schemaPath:"#/properties/contentEncoding/type",keyword:"type",params:{type: "string"},message:"must be string"}];
997
+ return false;
998
+ }
999
+ var valid0 = _errs94 === errors;
1000
+ }
1001
+ else {
1002
+ var valid0 = true;
1003
+ }
1004
+ if(valid0){
1005
+ if(data.if !== undefined){
1006
+ const _errs96 = errors;
1007
+ if(!(validate10(data.if, {instancePath:instancePath+"/if",parentData:data,parentDataProperty:"if",rootData}))){
1008
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
1009
+ errors = vErrors.length;
1010
+ }
1011
+ var valid0 = _errs96 === errors;
1012
+ }
1013
+ else {
1014
+ var valid0 = true;
1015
+ }
1016
+ if(valid0){
1017
+ if(data.then !== undefined){
1018
+ const _errs97 = errors;
1019
+ if(!(validate10(data.then, {instancePath:instancePath+"/then",parentData:data,parentDataProperty:"then",rootData}))){
1020
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
1021
+ errors = vErrors.length;
1022
+ }
1023
+ var valid0 = _errs97 === errors;
1024
+ }
1025
+ else {
1026
+ var valid0 = true;
1027
+ }
1028
+ if(valid0){
1029
+ if(data.else !== undefined){
1030
+ const _errs98 = errors;
1031
+ if(!(validate10(data.else, {instancePath:instancePath+"/else",parentData:data,parentDataProperty:"else",rootData}))){
1032
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
1033
+ errors = vErrors.length;
1034
+ }
1035
+ var valid0 = _errs98 === errors;
1036
+ }
1037
+ else {
1038
+ var valid0 = true;
1039
+ }
1040
+ if(valid0){
1041
+ if(data.allOf !== undefined){
1042
+ const _errs99 = errors;
1043
+ if(!(validate13(data.allOf, {instancePath:instancePath+"/allOf",parentData:data,parentDataProperty:"allOf",rootData}))){
1044
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
1045
+ errors = vErrors.length;
1046
+ }
1047
+ var valid0 = _errs99 === errors;
1048
+ }
1049
+ else {
1050
+ var valid0 = true;
1051
+ }
1052
+ if(valid0){
1053
+ if(data.anyOf !== undefined){
1054
+ const _errs100 = errors;
1055
+ if(!(validate13(data.anyOf, {instancePath:instancePath+"/anyOf",parentData:data,parentDataProperty:"anyOf",rootData}))){
1056
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
1057
+ errors = vErrors.length;
1058
+ }
1059
+ var valid0 = _errs100 === errors;
1060
+ }
1061
+ else {
1062
+ var valid0 = true;
1063
+ }
1064
+ if(valid0){
1065
+ if(data.oneOf !== undefined){
1066
+ const _errs101 = errors;
1067
+ if(!(validate13(data.oneOf, {instancePath:instancePath+"/oneOf",parentData:data,parentDataProperty:"oneOf",rootData}))){
1068
+ vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
1069
+ errors = vErrors.length;
1070
+ }
1071
+ var valid0 = _errs101 === errors;
1072
+ }
1073
+ else {
1074
+ var valid0 = true;
1075
+ }
1076
+ if(valid0){
1077
+ if(data.not !== undefined){
1078
+ const _errs102 = errors;
1079
+ if(!(validate10(data.not, {instancePath:instancePath+"/not",parentData:data,parentDataProperty:"not",rootData}))){
1080
+ vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors);
1081
+ errors = vErrors.length;
1082
+ }
1083
+ var valid0 = _errs102 === errors;
1084
+ }
1085
+ else {
1086
+ var valid0 = true;
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1091
+ }
1092
+ }
1093
+ }
1094
+ }
1095
+ }
1096
+ }
1097
+ }
1098
+ }
1099
+ }
1100
+ }
1101
+ }
1102
+ }
1103
+ }
1104
+ }
1105
+ }
1106
+ }
1107
+ }
1108
+ }
1109
+ }
1110
+ }
1111
+ }
1112
+ }
1113
+ }
1114
+ }
1115
+ }
1116
+ }
1117
+ }
1118
+ }
1119
+ }
1120
+ }
1121
+ }
1122
+ }
1123
+ }
1124
+ }
1125
+ }
1126
+ }
1127
+ }
1128
+ }
1129
+ }
1130
+ }
1131
+ }
1132
+ validate10.errors = vErrors;
1133
+ return errors === 0;
1134
+ }