Skip to content

Commit

Permalink
Merge pull request #55 from bcgov/dev
Browse files Browse the repository at this point in the history
Fix missing Object Array Data Type
  • Loading branch information
brysonjbest authored Nov 13, 2024
2 parents f77c88a + 81d187e commit 25a8e04
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api/decisions/validations/validations.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export class ValidationService {
throw new ValidationError(`Input ${field.field} should be a boolean, but got ${actualType}`);
}
break;
case 'object-array':
if (!Array.isArray(input) || !input.every((obj) => typeof obj === 'object')) {
throw new ValidationError(`Input ${field.field} should be an array of objects, but got ${actualType}`);
}
break;
default:
throw new ValidationError(`Unsupported data type: ${dataType}`);
}
Expand Down

0 comments on commit 25a8e04

Please sign in to comment.