This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-06
Channels
- # announcements (2)
- # beginners (97)
- # boot (3)
- # cider (23)
- # clara (9)
- # cljs-dev (40)
- # cljsrn (6)
- # clojure (107)
- # clojure-finland (2)
- # clojure-india (3)
- # clojure-italy (15)
- # clojure-nl (2)
- # clojure-spec (107)
- # clojure-uk (91)
- # clojurescript (28)
- # cursive (10)
- # data-science (4)
- # datomic (26)
- # duct (1)
- # emacs (6)
- # events (9)
- # figwheel-main (4)
- # fulcro (4)
- # graphql (2)
- # jobs (3)
- # jobs-discuss (12)
- # juxt (7)
- # kaocha (6)
- # off-topic (8)
- # onyx (2)
- # parinfer (13)
- # pedestal (32)
- # portkey (1)
- # re-frame (58)
- # reagent (17)
- # reitit (21)
- # ring-swagger (3)
- # shadow-cljs (35)
- # spacemacs (1)
- # tools-deps (33)
- # yada (13)
hi, let's say I have an API that has produces both application/json and application/edn. In case of an application/json response, i would like to update the response to strip namespaces from keywords. how would I implement this in a clean way in yada? I can walk the bidi tree and look at each methods :response
function, and adapt that based on the negotiated content-type, but isn't there a less 'invasive' way?
I'm not clear what you're asking
oh, and I only want it to happen for /api/v2
e.g. and not for /api/v1
(so no yada-wide setting by overriding e.g. render-map and render-seq)
You can ask in a response function what the negotiation is
Are you trying to do the same logic for many web resources?
You could add an interceptor after the response function interceptor
But yes, decorating the response function is a fine approach too