This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-21
Channels
- # admin-announcements (1)
- # beginners (3)
- # boot (242)
- # clara (1)
- # cljsrn (8)
- # clojars (2)
- # clojure (68)
- # clojure-russia (23)
- # clojure-spec (28)
- # clojure-uk (11)
- # clojurescript (7)
- # datavis (3)
- # datomic (21)
- # emacs (2)
- # events (2)
- # hoplon (56)
- # jobs (3)
- # lambdaisland (1)
- # mount (20)
- # off-topic (4)
- # om (13)
- # onyx (17)
- # other-languages (2)
- # parinfer (7)
- # proto-repl (2)
- # proton (2)
- # protorepl (53)
- # re-frame (13)
- # reagent (3)
- # ring-swagger (22)
- # specter (5)
anyone done much with clojure.spec conformers and using them for data conversion (similar to the way you can coerce in plumatic/schema)?
Yes, we're using them to map from an input domain to our internal domain model.
It can be a bit fussy if you're dealing with all string input and need to verify numeric ranges etc. We're still trying to figure out the best idiom for that sort of thing.
And mapping explain-data
back to error codes to respond to callers can be hairy too.
I'm wondering about going from string -> (nil | [string string int float float float]) and writing generators for that too that will have some positive test cases. 😉
(and thinking about it now I should probably add in string -> [string string string string string string] and then [string string string string string string] -> [string string int float float float])
Yeah, you end up having to wrap every input spec with a generator (so they generate conforming data and then call str
on it).