- Validator sets can now be used at the top level call to
validate
andvalid?
. - Added tested and a doc section around validation pipelining. It was an undocumented invariant. See discussion here.
-
defvalidator
now lets you define validators with arbitrary number of arguments. -
All validators are now implemented using
defvalidator
-
New validators:
member
- validates the value is a member of the provided collectionmatches
- regex validation (thanks to ghoseb)
-
Updated most validators' docstrings to something less confusing
-
Added API documentation using marginalia. See the
docs
folder or this link. -
bouncer now stores the error messages in the qualified keyword
:bouncer.core/errors
(thanks to ghoseb)For short, just use an alias:
(require '[bouncer.core :as c]) ;; then somewhere you want to inspect the errors map (::c/errors a-map)
-
short-circuit for validators: if a map entry has multiple validators, it stops at the first failure, moving on to the next map entry.
-
fixed destructuring bug when using Clojure 1.5 (thanks to Gary Johnson for reporting it)
-
using leiningen profiles to build against Clojure 1.3, 1.4 and 1.5
- One step towards composability: new 'defvalidatorset' macro that lets the user encapsulate common validation patterns into reusable units.
- Major overhaul of the validation DSL.
- Added the
defvalidator
macro to make defining new validation functions a whole lot simpler. - Moved built-in validators into the
bouncer.validators
namespace - New validator:
custom
- for ad-hoc validations using arbitrary functions
- Initial release.
- Public Macros
validate
valid
- Basic built-in validators
required
number
positive
every