title: Nestjs Global Validation Pipe unable to Parse Boolean Query Param
body: <p>In following controller, in the GET call I intend to pass a boolean parameter.</p>
  <pre><code>@Controller('tests')
  export class TestController {
      constructor(private readonly testService: TestService) {}
  
      @Get()
      async getTests(@Query() params: QueryParamDto) {
          return await this.testService.getTests(params.var);
      }
  }
  </code></pre>
  <p>and the Service method understands the type of <code>params.var</code> as a <code>boolean</code>.</p>
  <pre><code>@Injectable()
  export class TestService {
      @Get()
      async getTests(var: boolean) {
          return ...;
      }
  }
  </code></pre>
  <p>The <code>QueryParamDto</code> looks like.</p>
  <pre><code>export class QueryParamDto {
      @IsDefined()
      @IsBoolean()
      var: boolean;
  }
  </code></pre>
  <p>I have defined a Global Validation Pipe in <code>main.ts</code>.</p>
  <pre><code>async function bootstrap() {
    const app = await NestFactory.create(AppModule);
    app.useGlobalPipes(
      new ValidationPipe({
        transform: true,
      }),
    );
    await app.listen(3000);
  }
  bootstrap();
  </code></pre>
  <p>However, when I make a call to the endpoint <code>/tests?var=true</code> it is unable to parse the var as a boolean and errors.</p>
  <pre><code>{
      &quot;statusCode&quot;: 400,
      &quot;message&quot;: [
          &quot;var must be a boolean value&quot;
      ],
      &quot;error&quot;: &quot;Bad Request&quot;
  }
  </code></pre>
  <p>My understanding is that <code>app.useGlobalPipes(new ValidationPipe({transform: true...})</code> should automatically parse the params type as defined in the Dto, in this case <code>var</code> as <code>boolean</code> in <code>QueryParamDto</code>.</p>