Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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;
}
Source by github.com #
 
PREVIOUS NEXT
Tagged: #js #Validating #nested #objects
ADD COMMENT
Topic
Name
1+2 =