Fork me on GitHub

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:

 [: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 😄