Fork me on GitHub
#ring-swagger
<
2017-01-01
>
assoc-in21:01:11

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?

assoc-in21:01:22

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!

juhoteperi21:01:23

You can access the request like in normal compojure: (GET "..." req (println req))

assoc-in21:01:33

@juhoteperi Thanks that was what I was looking for