Validate Request with a Pipe

The ValidationPipe pipe

In this lesson, we’ll delve into setting up and implementing autovalidation with ValidationPipe. We’ll also explore how to use ValidationPipe for error handling and removing redundant properties to enhance the robustness of our application.

Installation

Although ValidationPipe is provided as part of the NestJS framework, we still need to install additional dependencies to use specific features. The ValidationPipe pipe relies on the class-validator and class-transformer packages to perform autovalidation. We must install these two dependencies using the command given below:

Get hands-on with 1400+ tech skills courses.