Skip to content
Myles Megyesi edited this page Apr 28, 2013 · 1 revision

Usage

(defvalidator user-validator
  [:website :url])

(user-validator {:website "foo://localhost"})
; {:website ["must be a valid url"]}

(user-validator {:website "http://google.com"})
; {}

Options:

  • allow-all-schemes Consider all schemes valid. Default false.
  • allow-local-urls Allows urls such as "http://localhost/". Default false.
  • allow-two-slashes Allows the path to have two trailing slashes. Default false.
  • no-fragments Disallows url fragments (trailing "#"). Default false.
  • schemes A list of schemes that should be considered valid. Default ["http" "https"].

None.

Default error message:

"must be a valid url"

Clone this wiki locally