title: Boolean parameter in request body is always true in NestJS api
body: <p>Consider this endpoint in my API:</p>
  
  <pre class="lang-js prettyprint-override"><code>@Post('/convert')
    @UseInterceptors(FileInterceptor('image'))
    convert(
      @UploadedFile() image: any,
      @Body(
        new ValidationPipe({
          validationError: {
            target: false,
          },
          // this is set to true so the validator will return a class-based payload
          transform: true,
          // this is set because the validator needs a tranformed payload into a class-based
          // object, otherwise nothing will be validated
          transformOptions: { enableImplicitConversion: true },
        }),
      )
      parameters: Parameters,
    ) {
      return this.converterService.start(image, parameters);
    }
  
  </code></pre>
  
  <p>The body of the request, which is set to <code>parameters</code> argument, contains a property called <code>laserMode</code> that should be a boolean type, it is validated like such on the <strong>parameters DTO</strong>:</p>
  
  <pre class="lang-js prettyprint-override"><code>  @IsDefined()
    @IsBoolean()
    public laserMode: boolean;
  
  </code></pre>
  
  <p>now the strange part, when a send a request from PostMan where:</p>
  
  <ol>
  <li><code>laserMode = false</code></li>
  <li><code>laserMode = cool</code> (a string other the  boolean value)</li>
  </ol>
  
  <p>I noticed that <code>laserMode</code> is <strong>always set to true</strong> and this is after the validation process is completed because when I <em>console.log</em> the instance of Parameter in the constructor of the class</p>
  
  <pre class="lang-js prettyprint-override"><code>export class Parameters {
    ...
    constructor() {
      console.log('this :', this);
    }
    ...
  }
  </code></pre>
  
  <p>I don't see the property!</p>
  
  <blockquote>
    <p><strong>Note</strong>: when <code>laserMode</code> is removed from the request, the expected validation errors are returned (should be defined, should be boolean value).</p>
  </blockquote>
  
  <pre class="lang-js prettyprint-override"><code>// the logged instance 'this' in the constructor
  this : Parameters {
    toolDiameter: 1,
    sensitivity: 0.95,
    scaleAxes: 200,
    deepStep: -1,
    whiteZ: 0,
    blackZ: -2,
    safeZ: 2,
    workFeedRate: 3000,
    idleFeedRate: 1200,
    laserPowerOn: 'M04',
    laserPowerOff: 'M05',
    invest: Invest { x: false, y: true }
  }
  // the logged laserMode value in the endpoint handler in the controller
  parameters.laserMode in controller : true
  // the logged laser value from the service
  parameters.laserMode in service : true
  </code></pre>
  
  <ul>
  <li>misspelling is checked</li>
  <li>same result is noticed when using a Vue app instead of postman.
  So!!?</li>
  </ul>