IsUUID Decorator problem. #2531
Replies: 1 comment
-
|
@karenfnet @Get(':id')
findOne(@Param('id', new ParseUUIDPipe({ version: '4' })) id: string) {
return this.service.findOne(id);
}this validates the param before it reaches the controller and returns a 422 if the UUID is invalid. if you still want to use a DTO approach for params, make sure your but for single-param validation, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@IsUUID works for Body() in Nest.js but doesn't work for Param() with its DTO, and I have global validation pipe, so everything must be validated to pass to controller, is there any solution?
Beta Was this translation helpful? Give feedback.
All reactions