This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-05
Channels
- # announcements (23)
- # babashka (23)
- # beginners (48)
- # calva (41)
- # clj-kondo (41)
- # cljs-dev (75)
- # cljsrn (5)
- # clojure (85)
- # clojure-europe (46)
- # clojure-nl (2)
- # clojure-spec (70)
- # clojure-uk (4)
- # clojurescript (52)
- # core-async (2)
- # cursive (16)
- # datahike (2)
- # datomic (4)
- # emacs (15)
- # figwheel-main (2)
- # fulcro (5)
- # gratitude (5)
- # helix (14)
- # introduce-yourself (2)
- # jackdaw (13)
- # keyboards (2)
- # lsp (8)
- # luminus (5)
- # malli (3)
- # meander (12)
- # nextjournal (52)
- # off-topic (19)
- # other-languages (1)
- # overtone (3)
- # pathom (4)
- # podcasts-discuss (1)
- # re-frame (6)
- # reitit (1)
- # releases (2)
- # ring (3)
- # sci (22)
- # shadow-cljs (3)
- # specter (1)
- # testing (3)
- # tools-deps (100)
- # uncomplicate (2)
(def LearningPathItems
[:schema {:registry
{::items
[:map
[:items
{:optional true}
[:vector
#_(mu/union LearningPathItemBase)
[:ref ::items]]]
;; marker
]}}
::items])
#_
(m/validate
LearningPathItems
{:items [{:items [{:items []}]}]})
this works. but when i want to introduce another spec to mix into the ref'd spec (to specify lots of other keys that any :items
child may have), it fails due to :malli.core/invalid-ref
. am i forced to put all of those other key specifications directly in at ;; marker
, or is there another way to compose it in?
I suppose i could just use Clojure to catenate two vectors but that feels dirty 😅this works i guess
(def LearningPathItemBase
[:map
[...]])
(def LearningPathItems
[:schema {:registry
{::items
(vec
(concat
[:map
[:items
{:optional true}
[:vector
[:ref ::items]]]]
(rest LearningPathItemBase)))}}
::items])