Last active
May 25, 2016 14:49
-
-
Save MichaelDrogalis/016ac62cf3f1e899fb89fd79f2de2277 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(s/def ::a integer?) | |
(s/def ::b string?) | |
(clojure.pprint/pprint (s/explain-data (s/keys :req [::a ::b]) {::a "foo" ::b "bar"})) | |
;; => | |
;; {:clojure.spec/problems | |
;; {[:empathy.api/a] | |
;; {:pred integer?, | |
;; :val "foo", | |
;; :via [:empathy.api/a], | |
;; :in [:empathy.api/a]}}} | |
(clojure.pprint/pprint (s/explain-data (s/keys :req [::a ::b]) {})) | |
;; => | |
;; {:clojure.spec/problems | |
;; {[] | |
;; {:pred [(contains? % :empathy.api/a) (contains? % :empathy.api/b)], | |
;; :val {}, | |
;; :via [], | |
;; :in []}}} | |
(clojure.pprint/pprint (s/explain-data (s/tuple ::a) [])) | |
;; => | |
;; {:clojure.spec/problems | |
;; {[] | |
;; {:pred (clojure.core/= (clojure.core/count %) 1), | |
;; :val [], | |
;; :via [], | |
;; :in []}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment