class Datetime {
@ApiProperty({
type: Date,
default: new Date(),
})
@IsDate()
datetime: Date;
}
export class MainDto {
@ApiProperty({ type: Datetime })
@ValidateNested()
@Type(() => Date)
datetime: Datetime
}
Why is it that when I put @IsDate() in MainDto it works, but when I put @IsDate() in Datetime it doesn't work? I want to do my validation on "child dto", I thought @ValidationNested() would run the validation on the child, and report error if any of the validation fails