title: Problems with ValidationPipe in NestJS when I need to validate the contents of an array
body: <p>I have a situation where my client user can enter zero or multiple addresses. My problem is that if he enters an address, some fields need to be mandatory.</p>
  <p><strong>user.controller.ts</strong></p>
  <pre><code>@Post()
  @UsePipes(ValidationPipe)
  async createUser(
      @Body() createUser: CreateUserDto,
  ) {
      return await this.service.saveUserAndAddress(createUser);
  }
  </code></pre>
  <p><strong>create-user.dto.ts</strong></p>
  <pre><code>export class CreateUserDto {
      @IsNotEmpty({ message: 'ERROR_REQUIRED_FULL_NAME' })
      fullName?: string;
  
      @IsNotEmpty({ message: 'ERROR_REQUIRED_PASSWORD' })
      password?: string;
  
      @IsNotEmpty({ message: 'ERROR_REQUIRED_EMAIL' })
      @IsEmail({}, { message: 'ERROR_INVALID_EMAIL' })
      email?: string;
  
      ...
  
      addresses?: CreateUserAddressDto[];
  }
  </code></pre>
  <p><strong>create-user-address.dto.ts</strong></p>
  <pre><code>export class CreateUserAddressDto {
      ...
  
      @IsNotEmpty()
      street: string;
  
      ...
  }
  </code></pre>
  <p><code>CreateUserDto</code> data is validated correctly and generates <code>InternalServerErrorResponse</code>, but <code>CreateUserAddressDto</code> data is not validated when there is some item in my array. Any idea how I can do this validation?</p>