ValidationPipe - forbidUnknownValues support
See original GitHub issueI’m submitting a…
[ ] 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.
Current behavior
ValidationPipe doesn’t support forbidUnknownValues
options property
Expected behavior
It should support it
Minimal reproduction of the problem with instructions
@UsePipes(new ValidationPipe({forbidUnknownValues: true}))
What is the motivation / use case for changing the behavior?
It is important validation mechanism also this option will be set to true in 1.0 class-validator release
Environment
Nest version: 5.0.0
For Tooling issues:
- Node version: 9.11.1
- Platform: Linux Debian Buster
Others:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Validation | NestJS - A progressive Node.js framework
The ValidationPipe provides a convenient approach to enforce validation rules for all ... forbidUnknownValues, boolean, If set to true, attempts to validate ...
Read more >Fixing validation error in NestJS when ... - Darragh ORiordan
Conclusion. You should be able to use the forbidUnknownValues setting in the validation pipe configuration as expected now. In general once I ...
Read more >Fixing validation error in NestJS when ... - DEV Community
Conclusion. You should be able to use the forbidUnknownValues setting in the validation pipe configuration as expected now. In general once I ...
Read more >Nestjs class validator dto validate body parameters
I want to throw BadRequest or something because test is not defined in dto. Can you guys help me? typescript · nestjs ·...
Read more >Documentation | NestJS - A progressive Node.js framework
As noted earlier, a validation pipe either returns the value unchanged, ... This is possible because Nest supports both synchronous and asynchronous pipes....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed in
v5.0.1
. Leaving opened to remember about the docsI 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