in src/validators/core/typeValidator.ts [26:53]
public validate(input: any, path?: string, field?: string): IValidationError[] {
if (input == null) {
return null;
}
if (!(Array.isArray(input))) {
return [{
message: field + " property is invalid",
path: (path ? path + "." : "") + field,
keyword: "type"
}];
}
for (let i = 0; i < input.length; i++) {
const fieldsPath = (path ? path + "." : "") + field + "." + i;
for (const validator of this.itemValidators) {
const errors = validator.validate(input[i], fieldsPath, field);
if (errors) {
return [{
message: field + " property is invalid",
path: (path ? path + "." : "") + field,
keyword: "type"
}];
}
}
}
return null;
}