Skip to content

Commit

Permalink
Merge pull request #52 from bcgov/fix/missing-data-type
Browse files Browse the repository at this point in the history
Fix missing object data type.
  • Loading branch information
brysonjbest authored Nov 13, 2024
2 parents e9e05b0 + 680e880 commit 81d187e
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 81d187e

Please sign in to comment.