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
I found out mostly through experimentation and examples that the :map and :ref schemas take only qualified keys and strings as registry references (as specified by malli.core/-reference?, it turns out)
The docs don't explicitly mention this requirement though, and the error messages produced by :map could be clearer:
(malli/schema [:map {:registry {:unqualified:any}}
:unqualified])
;; => Execution error (UnsupportedOperationException) at malli.core/-parse-entries$-parse (core.cljc:185).;; count not supported on this type: Keyword
(malli/schema [:map {:registry {:unqualified:any}}
[:unqualified]])
;; => Execution error (ExceptionInfo) at malli.impl.util/-fail! (util.cljc:16).;; :malli.core/invalid-schema {:schema nil}
Expected behavior:
Throw a :malli.core/invalid-ref error like the :ref schema does, including the invalid key in the error map.
I found out mostly through experimentation and examples that the
:map
and:ref
schemas take only qualified keys and strings as registry references (as specified bymalli.core/-reference?
, it turns out)The docs don't explicitly mention this requirement though, and the error messages produced by
:map
could be clearer:Expected behavior:
Throw a
:malli.core/invalid-ref
error like the:ref
schema does, including the invalid key in the error map.The text was updated successfully, but these errors were encountered: