malli 2024-09-26

Hello everyone. I have a use-case where if some key in a map is a certain value (it's an enum), then the schema is a certain way, if it's another, then it's another way. Is this something malli can validate? Another question, if a map contains a certain key, then this key must be a key of another, nearby map.

clojure
{:products {:x {:id 1 :wholesale? true} :y {:id 2} :z {:id 3}}
 :wholesale-prices {:x 40}} ;; :products must have an :x key and its :wholesale? property must be true
This is a simplified example. It's not possible to just put :price into the products map. Can this be done? Thanks in advance