This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-02
Channels
- # announcements (25)
- # babashka (76)
- # beginners (74)
- # biff (36)
- # calva (11)
- # cider (5)
- # clerk (43)
- # cljs-dev (4)
- # cljsrn (12)
- # clojure (111)
- # clojure-austin (14)
- # clojure-europe (82)
- # clojure-nl (2)
- # clojure-norway (5)
- # clojure-uk (1)
- # clojurescript (36)
- # core-async (13)
- # cursive (30)
- # datomic (12)
- # fulcro (6)
- # honeysql (9)
- # hyperfiddle (73)
- # instaparse (3)
- # introduce-yourself (1)
- # membrane (40)
- # nbb (2)
- # off-topic (6)
- # other-languages (9)
- # polylith (33)
- # reagent (2)
- # reitit (7)
- # rum (7)
- # shadow-cljs (47)
- # tools-deps (10)
- # vim (11)
- # xtdb (16)
When using Reitit with the default Muuntaja middleware, how can I get Muuntaja to completely ignore a specific route (with a specific method)? (Specifically, I want the body to remain an InputStream, even if Muuntaja would normally decode it)
FWIW from the documentation (https://cljdoc.org/d/metosin/reitit/0.5.18/api/reitit.ring.middleware.muuntaja) I figured I should be able to just add :muuntaja nil
to the route, i.e.:
["/my-path"
{:get ...
:put {:muuntaja niL
...}}]
...but this seems to have had no effectI was able to get it working by setting :muuntaja
to
(muuntaja/create
(->> {:decode-request-body? (constantly false)
:encode-response-body? (constantly false)}
(update muuntaja/default-options :http merge)))
...seems like there should be a simpler way though?I understand malli request coercion, you take some json object and it gets coerced using the schema to edn data. The relevant decoders are called. But what happens with response coercion? It seems like more is going on and I’m struggling to get my head around it.
Does it get decoded using the default coercer, then validated, then encoded using the encoder of the format
That's exactly what a comment in the source says! https://github.com/metosin/reitit/blob/master/modules/reitit-malli/src/reitit/coercion/malli.cljc#L67
thanks! @US1LTFF6D