We sometimes encounter server errors caused by a user providing input that’s longer than the database column size or even a non-existent ENUM value. Do not trust user input is a popular cliche that, if implemented, will save a lot of time and resources down the line.
That is why, in this article, we will be looking at the request-validator library, which is able to compare the user input against a pre-defined set of rules and return errors if any.