Open
Description
I'm staggered by how unintuitive this library is, time and again.
I have the following DTO:
class FormDto {
@IsNotEmpty()
@IsBoolean()
enabled: boolean
@ValidateIf((dto) => dto.enabled)
@IsArray()
@ValidateNested({ each: true })
@Type(() => UserDto)
users?: UserDto[];
}
When providing an invalid users array to the users
field, I'm getting a validation error even though the enabled
field is set to false
. Why?? I'm fine with submitting an invalid field when the flag is false.