How to validate an array of uuid ? I'm using the pre-built ParseArrayPipe to validate the payload array structure.
@Post(':id/players')
addPlayers(
@Body(new ParseArrayPipe({ items: GamePlayerDto, separator: ',' }))
gamePlayers: GamePlayerDto,
) {
console.log(gamePlayers);
}
export class GamePlayerDto {
@IsUUID()
playerId!: string;
}
I don't want class validator to check if playersId property is here but only raw value
e.g. this is what my server should received
["73aef2dd-c227-4774-b547-b3117b543863", "73aef2dd-c227-4774-b547-b3117b543863"]