Closed marceloschreiber closed 5 months ago
Good Morning.
:fn
wraps the predicates with m/-safe-pred
which doesn't throw. With custom schemas, you need to do this yourself, so:
(m/-simple-schema {:type :not-blank
:pred (m/-safe-pred not-blank?)
:type-properties {:error/message "must not be blank"}})
this should fix your orignal issue, but IMO the Tangential
could be resolved too.
created separate ticket for the Tangential
(#1001). Closing this one as resolved.
Thank you!
Problem
When not using a registry
m/explain
does not execute the second statement on a[:and ...]
schema. It just return that scheam error message [1]. When using a registrym/explain
executes the second statement and it throws [2].Expectation
I'd expect the call using registry to behave in the same one as the one that doesn't. Returning
["should be a string" "should not be blank"]
.Example
Tangential
Depending on the validation it doesn't make sense to display all error messages. Consider:
But in other cases it might, such as a password field:
I don't have a suggestion and I'd need some hammock time pondering about this problem.