👋 Hello Developers,
If you've been on the lookout for an out-of-the-box DTO Validator, your search ends here! ExpressoTS now offers a pre-integrated DTO Validator to make your life easier. 🎉
👉 Learn More
Here's how simple it is to use:
@httpPost("/", ValidateDTO(CreateUserDTO))
execute(@requestBody() payload: CreateUserDTO, @response() res: Response) {
return res.status(StatusCode.Created).json(this.createUserUseCase.execute(payload));
}
✨ Customization Flexibility
However, if our DTO Validator doesn't quite fit your unique needs, you're free to create your own provider! We've designed our system to be extensible, allowing you to plug in your own solutions.
Here's the signature you need to implement for your custom provider:
const yourprovider = (req: Request, res: Response, next: NextFunction) => { }
Add it to the endpoint decorator and voila, you've replaced ValidateDTO
with your own solution! 🛠️
For more information read the Official Documentation
Top comments (0)