NestJS · Junior · Question 32 of 75

What does the whitelist: true option of ValidationPipe do?

Explanation

It protects against clients sending extra fields like isAdmin. forbidNonWhitelisted: true rejects such requests with 400 instead.

Further reading

Problem with a question

NestJS · Junior · question 32

Test yourself

Take the NestJS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz