Put in order · NestJS course · Module 10: Data Validation

registerDecorator Structure

Arrange the elements for creating a custom validation decorator in the correct order:

Items to put in order

  • Use the decorator in a DTO: @IsMyValidator()
  • Implement a class with @ValidatorConstraint
  • Create a decorator function with registerDecorator
  • Implement validate() and defaultMessage() methods

You can check the correct answer by solving this task in the CodeWorlds game.