I'm using nestjs to implement an http-endpoint that receives a set of uuids via a query-parameter.
How can I apply pipes such as ParseUUIDPipe to such an array query-parameter?
@Get('test')
test(
@Query('id', ParseArrayPipe, ParseUUIDPipe): id: string[],
) { ... }
curl localhost/test?id=3b717319-e2c1-4807-a950-28b187661fe3&id=04500ae4-81b0-49ba-83f1-f9b69908f3ba
When ever multiple query-parameters are send to the endpoint, the ParseUUIDPipe rejects the request with the following error.
{
"statusCode":400,
"message":"The value passed as UUID is not a string",
"error":"Bad Request"
}
How can we let the pipe validate the individual string values of the array, not the string-array as a whole?