Now that we have learned how to use pipes in NestJS, let’s get back to our virtual library. In this section, we’ll use the class-validator decorators in our DTO and ValidationPipe to ensure data integrity in our virtual library.

Adding ValidationPipe in main.ts

Remember what we learned in the lesson on pipes? It’s time to apply it! Update the editor below to set ValidationPipe as a global pipe for our virtual library.

Get hands-on with 1200+ tech skills courses.