This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-01
Channels
- # beginners (71)
- # boot (148)
- # cider (21)
- # cljs-dev (2)
- # cljsjs (35)
- # clojure (212)
- # clojure-russia (42)
- # clojure-spec (36)
- # clojure-uk (28)
- # clojurescript (18)
- # cursive (2)
- # datascript (20)
- # datomic (2)
- # hoplon (2)
- # off-topic (355)
- # om (2)
- # onyx (1)
- # protorepl (1)
- # reagent (34)
- # ring-swagger (6)
- # rum (8)
- # sql (4)
- # untangled (64)
- # vim (22)
- # yada (1)
Howdy! I am attempting to use middleware with compojure-api and swagger for my api. The part I am struggling with is how to access the raw request from within an API endpoint. In liberator or other middleware setups the request map is passed into the function and I would be able to pull out the value that I added to the request map from my middleware function. Is there a way to do this with swagger?
I was able to get access to the value I added in my middleware by appending it to the :body-params key in the request map, but this doesn't seem like the best approach. Is there a better way I should be doing this? Thanks!
You can access the request like in normal compojure: (GET "..." req (println req))
https://github.com/weavejester/compojure/wiki/Destructuring-Syntax#regular-clojure-destructuring
@juhoteperi Thanks that was what I was looking for