This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-09
Channels
- # aws (1)
- # babashka (61)
- # bangalore-clj (5)
- # beginners (83)
- # biff (2)
- # calva (4)
- # cider (6)
- # clara (5)
- # clj-kondo (72)
- # cljs-dev (31)
- # cljsrn (28)
- # clojure (8)
- # clojure-australia (1)
- # clojure-europe (19)
- # clojure-france (1)
- # clojure-losangeles (21)
- # clojure-nl (2)
- # clojure-spec (2)
- # clojure-uk (9)
- # clojurescript (13)
- # clojureverse-ops (5)
- # code-reviews (1)
- # conjure (7)
- # cursive (4)
- # datascript (2)
- # datomic (8)
- # depstar (1)
- # emacs (3)
- # etaoin (1)
- # events (3)
- # exercism (7)
- # fulcro (6)
- # girouette (2)
- # graalvm (125)
- # honeysql (19)
- # integrant (1)
- # jobs (12)
- # lsp (1)
- # numerical-computing (1)
- # off-topic (23)
- # portal (12)
- # practicalli (1)
- # re-frame (35)
- # reitit (5)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (51)
- # tools-deps (14)
- # vim (3)
- # xtdb (20)
So, I have been reading and running through the debugger the code, and I have managed to pinpoint the issue to the function request-coercer
and the Coercion
protocol being called there on https://github.com/metosin/reitit/blob/master/modules/reitit-core/src/reitit/coercion.cljc.
On first sight, I am not so sure what the Coercion
is doing. I will keep banging at it, but if anyone can provide any pointers, they would be very much appreciated.
I actually started looking at spec-tools
rather than reitit
, because in my ignorance thought that was a likely location for the issue, and the code seemed simpler to wrap my head around. Under limited testing, that seemed to behave as expected under issue 494 conditions.
Not sure if you’re looking for a workaround for issue 494, but I’ve found wrapping the specs in st/spec
(where st is spec-tools) allows the coercion to happen.
For example:
(s/def ::or-example (st/spec (s/or
:one (st/spec string?)
:two (st/spec int))))
I am definitely looking for a workaround. Thanks for the info Tyler!
Oh, ok, I tried that one, and its well documented. But I did not understand that you need to wrap in st/spec
the inner specs also! Thank you very much for clarifying that.
Well, turns out I was wrong. Coercion
calls spec-tools
, and for the failing case in the issue's example, that call returns an empty map