DEV Community

Discussion on: Validating numeric query parameters in NestJS

Collapse
 
danielwong2268 profile image
Daniel Wong

Furthermore, I discovered it is required to pass in the following options to ValidationPipe

    new ValidationPipe({
      transform: true,
      transformOptions: {
        enableImplicitConversion: true,
      },
    }),
Enter fullscreen mode Exit fullscreen mode

else the type of the query param value at runtime will still be string, even though it may pass the class-validator validations.