This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-21
Channels
- # announcements (25)
- # beginners (31)
- # calva (7)
- # cider (21)
- # clj-kondo (3)
- # clojure (18)
- # clojure-bay-area (1)
- # clojure-europe (30)
- # clojure-norway (12)
- # clojurescript (5)
- # core-logic (1)
- # data-science (20)
- # datomic (7)
- # docker (3)
- # emacs (1)
- # gratitude (4)
- # honeysql (17)
- # hyperfiddle (15)
- # malli (9)
- # membrane (1)
- # nrepl (1)
- # off-topic (8)
- # other-languages (1)
- # overtone (48)
- # practicalli (1)
- # reitit (6)
- # shadow-cljs (30)
I get these kind of spec failures:
:in [0 375 :roklenarcic.security/underlying :roklenarcic.security/category],
:message "missing required key",
:path [0 0 :roklenarcic.security/underlying 0 :roklenarcic.security/category],
What’s the difference between :in
and :path
. In this case the actual element that is wrong is at 375, so why is path index [0 0 ….
?hi. Added documentation to this: https://github.com/metosin/malli/commit/142fefd3978fd0fbd0991cde48cbc3641a2ab33d
ok thanks
If :in
is the path in the value, does that make this a bug in path->in
?
(require '[malli.core :as m ])
(def my-schema
(m/schema [:orn
[:a-branch [:map [:a :int]]]
[:b-branch [:map [:b :int]]]]))
(let [{:keys [errors schema]} (m/explain my-schema {:a "2"})]
(mu/path->in schema (:path (first errors))))
;;=>
[:a-branch :a]
@UNCHWPV4Y could you file an issue out of this? should be a simple fix. I think same applies to :altn
and :catn
.
👍 1
looked at this with the morning ☕: https://github.com/metosin/malli/pull/969
If :in
is the path in the value, does that make this a bug in path->in
?
(require '[malli.core :as m ])
(def my-schema
(m/schema [:orn
[:a-branch [:map [:a :int]]]
[:b-branch [:map [:b :int]]]]))
(let [{:keys [errors schema]} (m/explain my-schema {:a "2"})]
(mu/path->in schema (:path (first errors))))
;;=>
[:a-branch :a]