This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-14
Channels
- # announcements (3)
- # asami (22)
- # babashka (9)
- # beginners (92)
- # calva (7)
- # clj-kondo (8)
- # clojure (61)
- # clojure-australia (3)
- # clojure-boston (1)
- # clojure-dev (3)
- # clojure-europe (24)
- # clojure-nl (3)
- # clojure-spec (4)
- # clojure-uk (14)
- # clojurescript (5)
- # conjure (12)
- # core-async (44)
- # cryogen (8)
- # crypto (2)
- # cursive (24)
- # data-science (5)
- # events (1)
- # fulcro (10)
- # garden (2)
- # graalvm (19)
- # helix (4)
- # instaparse (13)
- # lsp (13)
- # luminus (1)
- # malli (5)
- # meander (22)
- # off-topic (22)
- # polylith (8)
- # re-frame (69)
- # react (1)
- # reagent (2)
- # releases (2)
- # shadow-cljs (52)
- # sql (7)
- # test-check (3)
- # timbre (2)
- # tools-deps (9)
Hey 🙂 Is there a way to combine multiple schemas to one? Specifically I have a bunch of “base” keys and a few keys that I want to check based on the :type
key in the set of “base” keys. I kind of see how I could do that with multi and a bit of repetition but I probably want :merge
? Is there a way to get :merge
without getting into registries and all that?
Duh, I just realized I can just into
more key to existing [:map]
schemas
yeah. :multi
is not currntly mergable, oftenly asked. would allow concise definitions like:
[:merge
[:map [:id :uuid]]
[:multi {:dispatch :type}
[:pear [:size :int]]
[:boat [:price :int]]]]
Is there a “recommended way” to achieve this currently?
It seems like a common need so if there is one I think documenting that could be useful. Happy to open a PR once I know 😄