Therefore the correct amount of validation is that which satisfies whatever format the underlying API requires.
You mean the validation which the underlying API will perform on its own? You don’t need to do it.
Therefore the correct amount of validation is that which satisfies whatever format the underlying API requires.
You mean the validation which the underlying API will perform on its own? You don’t need to do it.
elrik@lemmy.world 1 year ago
I disagree. You should have validation at each layer, as it’s easier to handle bad inputs and errors the earlier they are caught.
It’s especially important in this case with email because often one or more of the following comes into play when you’re dealing with an email input:
I’m not suggesting that validation of an email should attempt to be exhaustive, but a well thought-out implementation validates all user inputs. Even the underlying API in this example is validating the email you give it before trying to send an email through its own underlying API.
Passing obvious garbage inputs down is just bad practice.