Pipes can overtake the validation responsibility, since it's possible to throw an exception when the data isn't correct.
The following patterns are considered warnings (fail):
class CatController {
@Post()
async create(@Body() createCatDto: CreateCatDto) { }
}
The following patterns are not warnings (pass):
@UsePipes(new ValidationPipe())
class CatController {
@Post()
async create(@Body() createCatDto: CreateCatDto) { }
}
class CatController {
@Post()
async create(@Body(new ValidationPipe()) createCatDto: CreateCatDto) { }
}
class {
@Post()
async create(@Body() createCatDto: any) { }
}