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
ok, I think that I will use that indeed
Are you trying to do the same logic for many web resources?
yes
so walking the bidi routes and then wrapping the :response function should work
You could add an interceptor after the response function interceptor
ok, that's another idea
yes, that'll probably be better 🙂
But yes, decorating the response function is a fine approach too
thanks!