how to use skipMissingProperties in pipe
See original GitHub issueI’m submitting a…
[ ] Regression
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[x] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
I hava an entity with class-validator
and pipe
, and it works well.
But the validator
will check the params always , it is unexpected. It may be like this: ‘insert’ will check all the params , and ‘update’ will check params which was post, and ‘delete’ will not check;
l have found something about this: skipMissingProperties: true
,and beforeInsert
from typeorm
, but i dont know when and where to use it ,could u please give me some help?
Environment
Nest version:4.6.6
For Tooling issues:
- Node version: 8.9.4
- Platform: Windows 10
Others:
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Use of Validation Pipe with class-validator - Stack Overflow
In your main.ts , you can add skipMissingProperties: true right into the ValidationPipe. app.useGlobalPipes( new ValidationPipe({ ...
Read more >Validation | NestJS - A progressive Node.js framework
The ValidationPipe makes use of the powerful class-validator package and its ... skipMissingProperties, boolean, If set to true then validator will skip ...
Read more >ValidatorOptions - @nestjs/common
Optional skipMissingProperties If set to true than validator will skip validation of all properties that are missing in the validating object.
Read more >Documentation | NestJS - A progressive Node.js framework
Pipes. A pipe is a class annotated with the @Injectable() decorator. Pipes should implement the PipeTransform interface. Pipes have two typical use cases:....
Read more >typeorm/typeorm - Gitter
It does, but you have to create a validation pipe (from the examples) and add a ... @mhombach and you are using skipMissingProperties...
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 FreeTop 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
Top GitHub Comments
@kamilmysliwiec doing what you propose, it continues validating all properties and I get Bad Request error.
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.