export class UpdateProfileDto {
@IsString()
name: string;
}
{ name: "Tom" }The handler receives { name: "Tom" }. whitelist silently removes properties that have no validation decorator. So isAdmin is removed and the request succeeds.
"Nothing: the request fails with 400 because isAdmin is not allowed" is wrong here. A 400 for unknown properties only happens if you also set forbidNonWhitelisted: true.
Read more
- Validation (https://docs.nestjs.com/techniques/validation)docs.nestjs.com