This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-19
Channels
- # beginners (37)
- # boot (96)
- # cider (23)
- # clara (2)
- # cljs-dev (40)
- # clojars (1)
- # clojure (149)
- # clojure-conj (1)
- # clojure-dev (2)
- # clojure-dusseldorf (5)
- # clojure-france (82)
- # clojure-italy (1)
- # clojure-nlp (1)
- # clojure-russia (13)
- # clojure-spec (24)
- # clojure-uk (62)
- # clojurescript (131)
- # core-async (13)
- # core-logic (7)
- # data-science (1)
- # datomic (10)
- # defnpodcast (3)
- # docker (4)
- # emacs (3)
- # events (4)
- # hoplon (68)
- # klipse (4)
- # leiningen (1)
- # off-topic (5)
- # om (140)
- # onyx (16)
- # pedestal (24)
- # planck (10)
- # proton (2)
- # re-frame (9)
- # reagent (4)
- # remote-jobs (1)
- # ring-swagger (16)
- # untangled (5)
- # vim (8)
- # yada (30)
is there a better example for specifying :formats
and :params-opts
currently in compojure-api? I’m not having success getting a custom :params-opts
working
@csm quick browse from my phone:
{:format {:params-opts {:transit-json {:handlers t/readers}}, :response-opts {:transit-json {:handlers t/writers}}}}
@abarylko we use sensu that hits the /metrics
endpoint in our application, loads into influxdb/graphana. before was reporting to librato
I think what I was stuck on is what t/readers
is supposed to be in the above. I tried a function that calls ring.middleware.format-params/wrap-format-params with my decoder (which parses graphql), but that function doesn’t ever seem to be called
but at any rate I just changed things around so the swagger UI looks right, and I’m just doing parsing of the raw request in the handler for now
@csm hmm.. coudn’t find anything with wrap-format-params
. Maybe you mean ring.middleware.format-params/wrap-restful-params
?
stuff under :format
gets passed to the wrap-restful-params
& wrap-restful-response
middleware (from ring-middleware-format).
the source code how the parameters are passed in is in here: https://github.com/metosin/compojure-api/blob/59b5d2271ac952ee6a7d3bad484f4e1510b18a59/src/compojure/api/middleware.clj#L240-L242 and an example of an custom format is here: https://github.com/metosin/compojure-api/issues/236#issuecomment-231552629