This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-16
Channels
- # announcements (11)
- # beginners (184)
- # calva (91)
- # cider (68)
- # cljdoc (42)
- # cljs-dev (44)
- # clojure (228)
- # clojure-dev (1)
- # clojure-europe (3)
- # clojure-italy (4)
- # clojure-losangeles (6)
- # clojure-nl (9)
- # clojure-spec (73)
- # clojure-uk (19)
- # clojurescript (61)
- # core-async (6)
- # cursive (2)
- # datomic (11)
- # fulcro (28)
- # hyperfiddle (16)
- # leiningen (2)
- # luminus (3)
- # off-topic (19)
- # om-next (1)
- # re-frame (2)
- # reagent (12)
- # reitit (4)
- # ring-swagger (5)
- # shadow-cljs (14)
- # slack-help (6)
- # spacemacs (2)
- # tools-deps (40)
- # vim (15)
- # yada (4)
If using Reitit with spec - is there possibility to coerce with default value? Example -> I have a body parameter as :foo which can be either “bar” “baz” “bat” but if it missing defaults to “bar”?
@heikki.hamalainen I don't think there is anything for defaults in spec currently. We just added support for default with Schema (https://github.com/metosin/schema-tools/blob/master/CHANGES.md#0105-2018-11-01), so I think it's doable for spec too.
for data-specs, it would be easy already, for vanilla specs, not so. The core team is doing spec-alpha2
atm, watching the repo, not sure will the keys
specs change to support this kind of things.
Ok, this could be good addition in the future. Reitit is very good alternative to compojure-api so hopefully sometime this is available 🙂