-
Notifications
You must be signed in to change notification settings - Fork 838
Closed
Labels
type: questionQuestions about the usage of the library.Questions about the usage of the library.
Description
Currently using -
- class-transformer - 0.2.3
- class-validator - 0.11.0
- express - 4.15.4
- node version - 13.9.0
I have 2 classes -
export class A {
@IsNotEmpty()
@Length(2, 32)
public someField: string;
@IsOptional()
@IsEnum(EnumClass)
public someEnum: EnumClass;
}
export class B {
@ValidateNested({ each: true })
@Type(() => A)
public arrayOfAs: A[];
}
For some reason - I get a BadRequest when I don't send the enum type although it's decorated with "IsOptional", am I doing something wrong or is that a bug? Couldn't find any sample of code to validate a nested object array with isOptional decoraror.
Metadata
Metadata
Assignees
Labels
type: questionQuestions about the usage of the library.Questions about the usage of the library.