Answers for "js Validating nested objects"

0

js Validating nested objects

// If your object contains nested objects and you want
// the validator to perform their validation too, 
// then you need to use the @ValidateNested() decorator:

import { ValidateNested } from 'class-validator';

export class Post {
  @ValidateNested()
  user: User;
}
Posted by: Guest on March-30-2022

Code answers related to "TypeScript"

Browse Popular Code Answers by Language