Skip to content

Instantly share code, notes, and snippets.

@Freid001
Freid001 / .lein-schema-demo
Last active April 19, 2018 10:27
Demo - How to use schmea and humanize.
; require our dependencies.
(require '[schema.core :as s]
'[humanize.schema :as h])
; lets define a few schemas, we want: first name, last name and office location (if available).
(def FirstName s/Str)
(def LastName s/Str)
(def Location (s/maybe (s/enum "london" "boston")))
; now try defining a schema map (and make location an optional parameter).