Name: schema-contrib
Owner: Crashlytics, Inc.
Description: Additional validators for Prismatic's Schema.
Created: 2015-08-03 21:38:26.0
Updated: 2015-08-03 21:38:26.0
Pushed: 2015-08-04 14:51:13.0
Homepage: null
Size: 128
Language: Clojure
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Additional validators for Prismatic's Schema.
ema-contrib "0.1.3"]
my-ns
require [schema.core :as s]
[schema-contrib.core :as sc]))
alidate sc/Country "us")
alidate sc/Country-Keyword :us)
alidate sc/Date "2014-01-01")
alidate sc/Email "brianb@arc90.com")
alidate sc/Language "en")
alidate sc/Language-Keyword :en)
alidate sc/ISO-Date-Time "2014-04-01T20:17:35+00:00")
alidate sc/Time "05:00")
alidate sc/URI "https://www.eff.org")
alidate sc/URI-Reference "relative/path/to/resource.txt")
If you're generating your schema with test.check and schema-gen, we have some generators, and are working on more.
my-ns
require [clojure.test.check.generators :as gen]
[schema-contrib.gen :as scgen]))
/sample scgen/country 5) ; => ("BY" "GF" "MA" "CD" "LB")
/sample scgen/country-keyword 5) ; => (:CI :PT :SZ :VU :BN)
/sample scgen/language 5) ; => ("vo" "br" "oj" "lu" "ss")
/sample scgen/language-keyword 5) ; => (:cr :hu :ak :ki :mk)
Copyright © 2014 SFX Entertainment
Distributed under the Eclipse Public License version 1.0.