Hello. I'm trying to load a list of UUIDs from the query params and I can't seem to find a solution to validate them as UUIDs. I can do this using class-validator directly in the controller method, but I was wondering if there is some way of using Nest to do this (like a DTO or pipe)
@Get()
@HttpCode(200)
async findAll(
@Query('ids', new ParseArrayPipe({ items: String, separator: ',' }))
ids: string[],
): Promise<Client[]> {
return this.clientService.findByIds(ids);
}
Being query params, I don't see how I can use a DTO for the items property because the request would be something like GET /?ids=30c06627-ecb7-4bb4-b579-014ebc02fafa,30c06627-ecb7-4bb4-b579-014ebc02fafa