A call to validation.is-email will raise an exception
when the input value is nil. This causes problems when using noir.validation
to validate inputs to (for example) a restful service, where it is possible for
the client to omit fields from the input data. For example:
(rule (has-value? user-email)
[:user-email "email is required"])
(rule (is-email? user-email)
[:user-email "email must be a valid email address"])
...would fail and raise an exception if the client had omitted the :user-email key from the supplied data. The expected behaviour should be that if the
client failed to supply an email address in their input, that both validation
messages would be triggered and the request would carry on as normal.
A call to validation.is-email will raise an exception when the input value is nil. This causes problems when using noir.validation to validate inputs to (for example) a restful service, where it is possible for the client to omit fields from the input data. For example:
...would fail and raise an exception if the client had omitted the
:user-email
key from the supplied data. The expected behaviour should be that if the client failed to supply an email address in their input, that both validation messages would be triggered and the request would carry on as normal.I will submit a pull request momentarily.