is there a way to do this :enum {:error/fn entity.validation/malli-humanize-enum-error}
for all enums in the spec, perhaps when calling m/humanize
?
otherwise i could walk the spec and inject them
@robert-stuttaford humanize
takes an :errors
option, where you can override :enum
handling. Walking is another way to do it. There might be others too
thanks @ikitommi - can you point me to example of the :errors
option specifically overriding the printing of errors for a specific spec type like :enum
that i can work from, please?
I would say (assoc me/default-errors :enum {:error/fn {:en my-fn-here}})
just to make sure that the whole :enum
map is overridden, can’t recall which one is picked first, :error/fn
or :error/message
if both are present
sure @robert-stuttaford, https://github.com/metosin/malli/blob/master/test/malli/error_test.cljc#L177-L188
ah so:
(assoc-in me/default-errors [:enum :error/fn :en] my-fn-here)
thanks!