Closed rudemex closed 2 years ago
Sending the correct parameters through the body in a PUT or PATCH returns a 400 Bad Request status with the message "an unknown value was passed to the validate function".
https://github.com/rudemex/nestjs-starter
It is expected to validate the body data against the DTO and make the change with an ok status.
@nestjs/class-transformer, @nestjs/class-validator, class-transformer
8.2.6
"@nestjs/class-transformer": "^0.4.0", "@nestjs/class-validator": "^0.13.3", "class-transformer": "^0.5.1",
14.15.4
Global Pipe validation config
// ./src/main.ts app.useGlobalPipes( new ValidationPipe({ validatorPackage: require('@nestjs/class-validator'), transformerPackage: require('class-transformer'), //whitelist: true, forbidUnknownValues: true, forbidNonWhitelisted: true, transformOptions: { enableImplicitConversion: true, }, }), );
Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.
Is there an existing issue for this?
Current behavior
Sending the correct parameters through the body in a PUT or PATCH returns a 400 Bad Request status with the message "an unknown value was passed to the validate function".
Minimum reproduction code
https://github.com/rudemex/nestjs-starter
Steps to reproduce
Expected behavior
It is expected to validate the body data against the DTO and make the change with an ok status.
Package
Other package
@nestjs/class-transformer, @nestjs/class-validator, class-transformer
NestJS version
8.2.6
Packages versions
Node.js version
14.15.4
In which operating systems have you tested?
Other
Global Pipe validation config