You can use the @IsOptional() validator:
Checks if given value is empty (
=== null,=== undefined) and if so, ignores all the validators on the property.
You can use the @IsOptional() validator:
Checks if given value is empty (
=== null,=== undefined) and if so, ignores all the validators on the property.