theleoborges / bouncer

A validation DSL for Clojure & Clojurescript applications
364 stars 38 forks source link

Why are these different? #53

Open FreekPaans opened 8 years ago

FreekPaans commented 8 years ago
(bouncer/validate
 {:date "2016-01-01"}
 :date validators/datetime (:mysql fmt/formatters))
Output ->
[nil {:date "2016-01-01"}]

(bouncer/validate
 {:date "2016-01-01"} 
 :date [[validators/datetime (:mysql fmt/formatters)]])
Output->
[{:date ("date must be a valid date")}
 {:date "2016-01-01" :bouncer.core/errors {:date ("date must be a valid date")}}]

From the documentation, I would've expected them to be equivalent, yet they aren't. What's going on?