You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Norm is proving to be very useful for validating schemas of internal processes. With that success, we're looking to use Norm as our primary validation within Ecto due to its robustness as well as an interest in keeping our approach to validation unified.
That said, the biggest thing that's holding us back is the error messages returned. Our approach to adding Norm errors to a changeset is simple (#7 (comment)), but results in errors like Title failed schema validation: &(String.length(&1) > 2) which is something we can't show to our end users.
I'd be open to taking a stab at allowing per-spec error messaging, but I worry that this would be outside of Norm's scope as it currently stands. Would there be any interest in a PR for this? If so, are there any suggestions for a preferred syntax?
The text was updated successfully, but these errors were encountered:
I've been thinking for a while about the best way to support customizable error messages. So far I haven't come up with anything that I really love. I was considering using a behaviour for this, but it would mean that you would need a way to set it either globally (probably through application env) or per spec or per conform call. Or perhaps some combination of all 3.
If you'd like to submit a PR I'd be happy to take a look at what you come up with. At the very least it would provide a basis for discussion.
Norm is proving to be very useful for validating schemas of internal processes. With that success, we're looking to use Norm as our primary validation within Ecto due to its robustness as well as an interest in keeping our approach to validation unified.
That said, the biggest thing that's holding us back is the error messages returned. Our approach to adding Norm errors to a changeset is simple (#7 (comment)), but results in errors like
Title failed schema validation: &(String.length(&1) > 2)
which is something we can't show to our end users.I'd be open to taking a stab at allowing per-spec error messaging, but I worry that this would be outside of Norm's scope as it currently stands. Would there be any interest in a PR for this? If so, are there any suggestions for a preferred syntax?
The text was updated successfully, but these errors were encountered: