title: ring-json's wrap-json-response middleware and compojure returns text/plain?
body: <p>I'm trying to use ring-json's wrap-json-response middleware within my compojure app. I have a simple GET handler that returns a map, like <code>{:foo 1}</code>, and when I hit the URL, ring responds with <code>text/plain</code> and an empty response body. I can't seem to get it to respond with the JSON version of the map.</p>
  
  <p>Here's my handler code:</p>
  
  <pre><code>(ns localshop.handler
    (:use compojure.core)
    (:require [localshop.routes.api.items :as routes-api-items]
              [ring.middleware.json :as middleware]
              [compojure.handler :as handler]
              [compojure.route :as route]))
  
  ;; map the route handlers
  (defroutes app-routes
    (context "/api/item" [] routes-api-items/routes))
  
  ;; define the ring application
  (def app
    (-&gt; (handler/api app-routes)
        (middleware/wrap-json-body)
        (middleware/wrap-json-params)
        (middleware/wrap-json-response)))
  </code></pre>
  
  <p>The route handler function literally just returns a map, so the code for that is simple enough that I think I could leave out. If returning a map from a compojure route handler is the problem, then perhaps that's it?</p>