crashlytics/schema-contrib

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

schema-contrib

Additional validators for Prismatic's Schema.

Build Status

Clojars
ema-contrib "0.1.3"]
Usage
Schema
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")
Generators

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)
TODO
License

Copyright © 2014 SFX Entertainment

Distributed under the Eclipse Public License version 1.0.

Credits

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.