- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.1k
Closed
Description
I'm submitting a...
[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
When submitting unexpected properties in the body of an HTTP request (POST/PUT endpoints), the validation pipe (using class-transformer and class-validator) allows it without sending any warning or allowing us to forbid this behavior.
I assume this is linked to typestack/class-validator#118
Expected behavior
When submitting {"name": "Fluffy Cat", "age": 15, "paws": 3} whereas the DTO is {name: string, age: number}, the property paws should be stripped or raise (in some way) a validation error.
What is the motivation / use case for changing the behavior?
Allowing developers to reject payloads with unexpected properties, just like Joi or AJV. This is especially dangerous for MongoDB users, who might store the provided input "as is".
Environment
Nest version: 4.5.1
 
For Tooling issues:
- Node version: 8.9+  
- Platform:  Linux 
aljazerzen and vladmiller
Metadata
Metadata
Assignees
Labels
No labels