Complete the code to import the validation decorator for nested objects in NestJS.
import { [1] } from 'class-validator';
The ValidateNested decorator is used to validate nested objects inside DTOs in NestJS.
Complete the code to apply nested validation on the 'address' property inside a DTO.
export class UserDto { @[1]() address: AddressDto; }
The ValidateNested decorator tells NestJS to validate the nested AddressDto object inside UserDto.
Fix the error in the code to ensure nested DTO validation works correctly with class-transformer.
export class UserDto { @ValidateNested() @[1](() => AddressDto) address: AddressDto; }
The Type decorator from class-transformer is required to tell NestJS how to transform and validate nested objects.
Fill both blanks to define a nested DTO with validation decorators for its properties.
export class AddressDto { @[1]() street: string; @[2]() city: string; }
IsString ensures the property is a string, and IsNotEmpty ensures it is not empty. Both are common validations for address fields.
Fill all three blanks to create a nested DTO with validation and type transformation.
import { [1] } from 'class-transformer'; import { [2], ValidateNested } from 'class-validator'; export class ProfileDto { @ValidateNested() @[3](() => UserDto) user: UserDto; }
The Type decorator from class-transformer is imported and used to specify the nested type. IsString is imported but not used here, showing common imports. ValidateNested is imported from class-validator but already used in code.