This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-28
Channels
- # aatree (1)
- # admin-announcements (5)
- # beginners (5)
- # braid-chat (2)
- # cbus (2)
- # cljs-dev (8)
- # cljsrn (13)
- # clojure (101)
- # clojure-chicago (1)
- # clojure-greece (11)
- # clojure-russia (77)
- # clojure-taiwan (1)
- # clojure-uk (5)
- # clojurescript (73)
- # core-async (5)
- # core-matrix (1)
- # cursive (5)
- # datomic (10)
- # devcards (44)
- # emacs (16)
- # hoplon (207)
- # keechma (5)
- # lein-figwheel (1)
- # leiningen (5)
- # liberator (3)
- # melbourne (1)
- # om (171)
- # onyx (25)
- # parinfer (1)
- # proton (2)
- # re-frame (28)
- # reagent (50)
- # untangled (7)
- # yada (4)
I want to create an API which has a lot of large domain objects (think 20+ attributes each). I was looking into using defrecord and Plumatic's schema. A lot of these attributes are optional though and I'm not sure how to declare default values. Would you create factory functions? Would those than just take normal maps again? Any other options to make it less painful to use this API?
Merge the incoming data with default data before validating? Possibly have separate schema for the incoming data and the internal data, particularly if you’re leaning on schema coercion for the incoming data.