malli 2025-07-14

Hi, is there a way to express :min and :max with number? like it is for :int as in [:map [:num [:int {:min 1 :max 100}]]]?

The predicate schemas like number? don't allow this. One way to achieve something similar would be e.g.

(malli.core/validate
 [:or
  [:int {:min 1 :max 100}]
  [:double {:min 1 :max 100}]]
 19.0)

Or with comparator schemas

(malli.core/validate
 [:and [:>= 1] [:<= 100]] 19.0)

@matti.uusitalo117 thanks, that's reasonable