Question: At the moment, I have a very simple class-validator file with a ValidationPipe in Nest.js as follows: Lets say in the above “UpdateUserDto,” the user passes an “email” field. I want to build a custom validation rule through class-validator ...

Question: I’m trying to validate the number of digits for numeric values using class-validator. For example: my entity can accept only numbers of 6 digits for a given property. This way I’ve tried using a combination of IsNumber, MinLength and ...

Question: I have a custom class-validator rule: How do I access the request object inside the validate() method? Answer: I ended up using a custom interceptor: If you have better answer, please add a comment about this, thank you! ...