I'm using NestJS and I'm trying to get auto-transform for params to work. I've added that code:
app.useGlobalPipes(
new ValidationPipe({
transform: true,
}),
);
And I have a controller that receives a numeric param:
@Get(':id')
getStuff(@Param('id') id: number) {
...
}
The problem is when I try to use a non numeric param (path/to/controller/one instead of path/to/controller/1) I receive a 500 Internal Server error instead of the expected 400 response. What am I missing?
Thanks!