This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-18
Channels
- # aws (1)
- # aws-lambda (1)
- # beginners (48)
- # boot (15)
- # cider (3)
- # cljs-dev (4)
- # cljsrn (4)
- # clojure (241)
- # clojure-chicago (1)
- # clojure-dusseldorf (12)
- # clojure-greece (41)
- # clojure-italy (3)
- # clojure-russia (16)
- # clojure-spec (7)
- # clojure-uk (34)
- # clojurescript (88)
- # community-development (9)
- # cursive (8)
- # data-science (55)
- # datomic (40)
- # devops (1)
- # emacs (20)
- # fulcro (19)
- # graphql (3)
- # hoplon (46)
- # luminus (11)
- # lumo (4)
- # off-topic (27)
- # onyx (26)
- # other-languages (25)
- # pedestal (2)
- # powderkeg (6)
- # re-frame (11)
- # reagent (4)
- # ring-swagger (17)
- # rum (4)
- # shadow-cljs (103)
- # spacemacs (14)
- # specter (6)
- # unrepl (21)
- # yada (1)
one could ask (methods multimethod)
to verify that when app is created, all things are bound. But still, configuration via multimethods is imperative, opposed of purely functional transformation of a single (admittedly, huge) configuration map. I think data is the way to go at the lowest level anyway, there could be helpers on top. Let’s draft something and see how they look like
@slipset if the spec-coercion fails, the result fails to serialize. Root cause is that we are returning the Spec :problems
over the wire and the :pred
can be anything - here it’s (partial instance? DateTime)
which fails to serialize. Wrapping the :pred
to str
should make the errors correct. Here, it would be:
{:spec "(spec-tools.core/spec {:spec (clojure.spec.alpha/keys :req-un [:compojure.api.coercion.erik/id :compojure.api.coercion.erik/name :compojure.api.coercion.erik/date]), :type :map, :keys #{:date :name :id}, :keys/req #{:date :name :id}})",
:problems [{:path ["date"],
:pred "(clojure.core/partial clojure.core/instance? org.joda.time.DateTime)",
:val "lol",
:via ["compojure.api.coercion.erik/id-name-date" "compojure.api.coercion.erik/date"],
:in ["date"],
:reason "FAIL"}],
:type "compojure.api.exception/response-validation",
:coercion "spec",
:value {:id 1, :name "foo", :date "lol"},
:in ["response" "body"]}