Fork me on GitHub

What's the best way to update the properties of a map entry? I've got a schema like [:map [:a :string] [:b :string]], and I want to transform it into something like [:map [:a :string] [:b {:my-date :foo} :string]]. mu/update-properties only works for the :map-level, so I tried combining it with mu/update and giving a path into the map, but that also doesn't seem to be what I want. Is there a simpler way to achieve this that I'm overlooking?


You can walk the children or wait for to be merged


(defn map-children [f schema]
  (m/-into-schema (m/-parent schema) (m/-properties schema) (map f children) (m/-options schema)))


that's the idiomatic way to create a copy of a schema with some changes