metosin / malli

High-performance data-driven data specification library for Clojure/Script.
Eclipse Public License 2.0
1.44k stars 204 forks source link

`malli.experimental.describe` descriptions of `:min` and `:max` are backwards #924

Closed camsaul closed 9 months ago

camsaul commented 11 months ago
(require '[malli.experimental.describe :as med])

(med/describe [:string {:min 5}])
;; => "string with length <= 5"

(med/describe [:string {:max 5}])
;; => "string with length >= 5"

The generated descriptions have <= and >= and mixed up. The description for [:string {:min 5]} (a string that has at least a minimum 5 characters, i.e. a string whose length is >= 5) is string with length <= 5, i.e. the string's length must be less than or equal to 5.

ikitommi commented 11 months ago

PR most welcome.