[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
ValidationPipe doesn't support forbidUnknownValues
options property
It should support it
@UsePipes(new ValidationPipe({forbidUnknownValues: true}))
It is important validation mechanism also this option will be set to true in 1.0 class-validator release
Nest version: 5.0.0
For Tooling issues:
- Node version: 9.11.1
- Platform: Linux Debian Buster
Others:
Actually, it is supported (https://docs.nestjs.com/pipes)
I couldn't get it working, but it might be related to some 'class-validator' bug. Anyway i think we need to include it in https://github.com/nestjs/nest/blob/master/packages/common/interfaces/external/validator-options.interface.ts
This worked for me: new ValidationPipe({whitelist: true, forbidNonWhitelisted: true})
Ahh, got it. forbidNonWhitelisted
is missing in the ValidatorOptions
interface. I'll fix it soon.
Fixed in v5.0.1
. Leaving opened to remember about the docs
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Fixed in
v5.0.1
. Leaving opened to remember about the docs