Skip to content

inclusion

Myles Megyesi edited this page Oct 6, 2012 · 3 revisions

Usage

(defvalidator user-validator
  [:color :inclusion {:in [:blue :orange]}])

(user-validator {:color :pink})
; {:color ["is not included in the list"]}

(user-validator {:color :blue})
; {}

Options:

  • :in Value must be in the given collection. Default [].

Default error message:

"must be included in the list"