Fork me on GitHub
#malli
<
2022-11-15
>
agigao13:11:57

In the context of coercion - can we process data before we pass it to a schema nested one level deeper? For example:

(def file-metada
  [:map
   [:name string?]
   [:file file-content]])

(def file-content
  [:vector
   [:map
    [:id uuid?]
    [:name string?]]])
Actually read the file and transform data before passing to file-content for validation.

ikitommi13:11:20

something I wrote.

👍 10
dumrat03:11:37

I have been looking for something like this. I thought to myself "Surely malli must have some way to transform data - not just coerce". I will give meander a go.

👍 1
ikitommi06:11:41

planning to add some helpers in Malli for this, e.g. a pre-build matcher, meander-transformer, visualization etc. Needs to play with this a bit to see what is the relevant reusable part first.

👍 2
1
agigao09:11:51

Thank you!