title: Validate nested objects using class validator and nestjs
body: <p>I'm trying to validate nested objects using class-validator and NestJS. I've already tried following this <a href="https://stackoverflow.com/a/53685045/4694994">thread</a> by using the <code>@Type</code> decorator from class-transform and didn't have any luck. This what I have:</p>
  <p><strong>DTO:</strong></p>
  <pre><code>class PositionDto {
    @IsNumber()
    cost: number;
  
    @IsNumber()
    quantity: number;
  }
  
  export class FreeAgentsCreateEventDto {
  
    @IsNumber()
    eventId: number;
  
    @IsEnum(FinderGamesSkillLevel)
    skillLevel: FinderGamesSkillLevel;
  
    @ValidateNested({ each: true })
    @Type(() =&gt; PositionDto)
    positions: PositionDto[];
  
  }
  </code></pre>
  <p>I'm also using built-in nestjs validation pipe, this is my bootstrap:</p>
  <pre><code>async function bootstrap() {
    const app = await NestFactory.create(ServerModule);
    app.useGlobalPipes(new ValidationPipe());
    await app.listen(config.PORT);
  }
  bootstrap();
  </code></pre>
  <p>It's working fine for other properties, the array of objects is the only one not working.</p>