NestJS · Junior · Question 32 of 75
What does the whitelist: true option of ValidationPipe do?
- ✓Correct answer: Strips properties that have no validation decorators in the DTO
- 2Skips validation for admin users
- 3Allows only whitelisted IP addresses
Explanation
It protects against clients sending extra fields like isAdmin. forbidNonWhitelisted: true rejects such requests with 400 instead.