I'm reading over the pipe page and came across this section.
According to this, we need to create our DTOs to make sure our data coming from the body/params is formatted correctly. The validation happens when the method is executed. At the same time, we also need to create a validation pipe schema (tool like Joi) to validate the data before the method executes.
Yet in the example, they are using both. Why? Seems like we are building in two levels of validation to validate the same thing. The DTO seems excessive at times already. Why add more excess?
Ref URL: https://docs.nestjs.com/pipes#binding-validation-pipes