How can I handle the validation of an array of numbers in form data? Because I am passing data in a form-data format, I can't validate an array of numbers Actually, I don't know how to do it.
This is my CreatePostDto:
export class CreatePostDto {
@IsNotEmpty()
@IsString()
@MinLength(3)
title: string;
@ApiProperty({ type: 'string', format: 'binary' })
thumbnail: any;
@IsNotEmpty()
@IsString()
@MinLength(20)
@MaxLength(300)
description: string;
@IsNotEmpty()
@IsString()
@MinLength(20)
body: string;
@IsOptional()
@Type(() => Number)
@IsNumberString({}, { each: true })
tags: number[];
@IsOptional()
@Type(() => Number)
@IsNumberString({}, { each: true })
categories: number[];
@IsBooleanString()
published: boolean;
}

