Fork me on GitHub

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))


@juhoteperi Thanks that was what I was looking for