import { ValidateNested } from 'class-validator';
export class Post {
@ValidateNested()
user: User;
}
class Info {
readonly title:string
readonly score:number
readonly description:string
readonly dateOfCreation:Date
}
export class SampleDto {
@Type(() => Info)
@ValidatedNested()
readonly info: Info
...Follow same for the rest of schema
}
import { ValidateNested } from 'class-validator';
export class Post {
@ValidateNested()
user: User;
}