Closed ikitommi closed 9 years ago
I guess the last one should work?
➜ ~ lein try prismatic/schema nREPL server started on port 61622 on host 127.0.0.1 - nrepl://127.0.0.1:61622 REPL-y 0.3.7, nREPL 0.2.10 Clojure 1.7.0 Java HotSpot(TM) 64-Bit Server VM 1.8.0_31-b13 tommi's repl. user=> (require '[schema.core :as s]) nil user=> (require '[schema.coerce :as sc]) nil user=> ((sc/coercer s/Int sc/string-coercion-matcher) "1") 1 user=> ((sc/coercer (s/enum 1 2) sc/string-coercion-matcher) "1") #schema.utils.ErrorContainer{:error (not (#{1 2} "1"))}
fixed typo in the example, sc/+string-coercions+ => sc/string-coercion-matcher.
sc/+string-coercions+
sc/string-coercion-matcher
coerced keywords is enums do work, so don't need this. Closing it.
I guess the last one should work?