title: How to validate a DTO fields?
body: <p>I have an endpoint with no entry params:</p>
  <pre><code>async myendpoint(): Promise&lt;any&gt; {
     const customer = await this.customerService.findOne(1);
     if (customer) {
        return await this.customerService.mapToDestination(customer);
     }...
  }
  </code></pre>
  <p>Then I have my method mapToDestination where I simply assign vars:</p>
  <pre><code>async mapToDestination(customer: Customer): Promise&lt;DestinationDto&gt; {
      const destination: DestinationDto = {
            lastname: customer.lastname,
            firstname: customer.firstname,...
  </code></pre>
  <p>Finally, I have my DTO:</p>
  <pre><code>import {IsEmail, IsNotEmpty, IsOptional, IsNumber, IsBoolean, IsString, IsDate, MaxLength, Length, NotEquals} from 'class-validator';
  import {ApiProperty} from '@nestjs/swagger';
  
  export class DestinationDto {
  
  
    @IsString()
    @IsNotEmpty()
    @MaxLength(32)
    lastname: string;
  
    @IsString()
    @IsNotEmpty()
    @MaxLength(20)
    firstname: string; ...
  </code></pre>
  <p>I would like my DTO fields to be validated automatically following the decorators when I'm mapping it in my <code>mapToDestination()</code> method. I look through the web and the official documentation and I gave a try to Validators (ValidationPipe) but it does not seem to be my need as it validates the endpoint entry params.</p>
  <p>Please, could you explain to me how to achieve this automatic validation? Thanks in advance.</p>