Just for fn.
(def schema {:age integer?
:gender #(boolean (some (partial = %) ["m" "w"]))})
(defn in? [xs]
#(boolean (some (partial = %) xs)))
(def schema {:age integer?
:gender (in? ["m" "w"])})
(valid? {:name "John" :age 20 :gender "m"} schema) ; => true
(valid? {:name "John" :gender "m"} schema) ; => false
(validate {:name "John" :gender "m"} schema) ; => {:age false, :gender true}
- One validation function per field
- No error messages