fix: enable implicit conversion in StrictValidationPipe
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 45s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 45s
Query string params (page=1&limit=5) arrive as strings but DTOs expect @IsInt(). enableImplicitConversion tells class-transformer to auto-cast types based on the DTO decorators. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
82e3a60101
commit
137fe36a72
@ -15,7 +15,7 @@ export class StrictValidationPipe implements PipeTransform<any> {
|
||||
if (!metatype || !this.toValidate(metatype)) {
|
||||
return value;
|
||||
}
|
||||
const object = plainToInstance(metatype, value);
|
||||
const object = plainToInstance(metatype, value, { enableImplicitConversion: true });
|
||||
const errors = await validate(object, {
|
||||
whitelist: true,
|
||||
forbidNonWhitelisted: true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user