Liking cljdoc? Tell your friends :D

bouncer.validators

This namespace contains all built-in validators as well as macros for defining new validators and validator sets

This namespace contains all built-in validators as well as
macros for defining new validators and validator sets

boolean

source

custom

source

datetime

source

defvalidatormacro

Clojure arglists
(defvalidator name docstring? opts-map? [args*] & body)
ClojureScript arglists
(defvalidator &form &env name & options)

Defines a new validating function using args & body semantics as provided by "defn". docstring and opts-map are optional

opts-map is a map of key-value pairs and may be one of:

  • :default-message-format used when the client of this validator doesn't provide a message (consider using custom message functions)

  • :optional whether the validation should be run only if the given key has a non-nil value in the map. Defaults to true.

or any other key-value pair which will be available in the validation result under the :metadata key.

The function will be called with the value being validated as its first argument.

Any extra arguments will be passed along to the function in the order they were used in the "validate" call.

e.g.:

(defvalidator member [value coll] (some #{value} coll))

(validate {:age 10} :age member (range 5))

This means the validator member will be called with the arguments 10 and (0 1 2 3 4), in that order.

Defines a new validating function using args & body semantics as provided by "defn".
docstring and opts-map are optional

opts-map is a map of key-value pairs and may be one of:

- `:default-message-format` used when the client of this validator doesn't
provide a message (consider using custom message functions)

- `:optional` whether the validation should be run only if the given key has
a non-nil value in the map. Defaults to true.

or any other key-value pair which will be available in the validation result
under the `:metadata` key.

The function will be called with the value being validated as its first argument.

Any extra arguments will be passed along to the function in the order they were used in the
"validate" call.

e.g.:


  (defvalidator member
    [value coll]
    (some #{value} coll))

  (validate {:age 10}
    :age [[member (range 5)]])


This means the validator `member` will be called with the arguments `10` and `(0 1 2 3 4)`,
in that order.
source (clj)source (cljs)raw docstring

email

source

every

source

in-range

source

integer

source

matches

source

max-count

source

member

source

min-count

source

number

source

positive

source

required

source

string

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close