NestJS 11 · Validation, guards and interceptors

Enable validation globally

Validate and transform every request body. whitelist removes properties the DTO doesn't declare.

app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));

Official NestJS 11 documentation

More validation, guards and interceptors commands

All validation, guards and interceptors commands · NestJS 11 cheatsheet

Was this page helpful?