if a defmsg is set on ::bar it will return that one first, if none is
set on on ::bar, then it would check for one on ::foo, then on ::str,
and ultimately on `string?
It also allows to set messages for full forms, so you can add a defmsg on 'clojure.core/string? '(s/coll-of string?) etc (as demonstrated in tests).
To make this happen a expound.util/spec-vals function is implemented
that will return a lazyseq of keys related to a spec, starting with
the spec key in question:
(spec-vals ::bar) would return (::bar ::foo ::str 'clojure.core/string?) from there error-message will check for these keys in the message registry until there is match.
This also makes defmsg check all spec value in the spec "path"
if a defmsg is set on ::bar it will return that one first, if none is set on on ::bar, then it would check for one on ::foo, then on ::str, and ultimately on `string?
It also allows to set messages for full forms, so you can add a defmsg on 'clojure.core/string? '(s/coll-of string?) etc (as demonstrated in tests).
To make this happen a expound.util/spec-vals function is implemented that will return a lazyseq of keys related to a spec, starting with the spec key in question:
(spec-vals ::bar)
would return(::bar ::foo ::str 'clojure.core/string?)
from there error-message will check for these keys in the message registry until there is match.