This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hello, trying out Malli and confused about this difference in behavior. I expected them to be the same. When having something such as [:and :string :not-blank]
how can I avoid executing :not-blank
when :string
already failed?
Hi. Currently, :and
explain on all their childs:
(-> [:and [:string {:min 1}] #"kikka"]
(m/explain :kikka)
(me/humanize))
; => ["should be a string" "should match regex"]
Maybe better default would be to just to use the first one instead.e.g. this makes no sense:
(-> [:and
[:vector :any]
[:fn {:error/message "should be distinct"} #(= % (distinct %))]]
(m/explain :invalid)
(me/humanize))
; => ["invalid type" "should be distinct"]
sure! Thanks for looking at this.