This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-16
Channels
- # beginners (11)
- # boot (21)
- # cider (12)
- # clara (6)
- # cljs-dev (7)
- # cljsjs (1)
- # cljsrn (62)
- # clojure (137)
- # clojure-austin (5)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-russia (46)
- # clojure-spec (21)
- # clojure-uk (79)
- # clojurescript (56)
- # clr (1)
- # core-typed (1)
- # css (1)
- # cursive (3)
- # datomic (35)
- # docker (2)
- # emacs (20)
- # garden (3)
- # hoplon (8)
- # incanter (3)
- # jobs (12)
- # mount (5)
- # nginx (1)
- # off-topic (71)
- # om (8)
- # om-next (6)
- # onyx (4)
- # perun (3)
- # proton (2)
- # protorepl (5)
- # re-frame (35)
- # reagent (38)
- # ring (5)
- # ring-swagger (12)
- # rum (35)
- # spacemacs (2)
- # specter (5)
- # test-check (6)
- # yada (52)
@borkdude the clients can negotiate the response, done in api
: just return clojure data from an endpoint, and if the client send accept-header with value application/transit+json
, it’s returned
with 1.2 you have more options: create transit body yoirself and set the content-type or add a key :muuntaja.core/content-type
with value application/transit+json
to the response map => will be forced to be transit.
if you have a POST endpoint with defined response model, you can poke with swagger-ui: there is a dropdown to select both the request-format and the response-format.
I’m dealing with a POST endpoint but I don’t see the response dropdown in swagger. We’re using 1.1.9
It didn’t work after all, alas. I made a test endpoint which just returns a hash-map. Code:
(POST "/test" []
(ok {:foo “bar”}))
Swagger:
https://www.dropbox.com/s/z9h8beagk9q4l9k/Screenshot%202017-01-16%2015.18.43.png?dl=0