ring-middleware-format icon indicating copy to clipboard operation
ring-middleware-format copied to clipboard

allow passing response-predicate to wrap-restful-format

Open ninjudd opened this issue 9 years ago • 3 comments

I'm not sure if this is the best fix for it, but right now, there is no way to pass :predicate to wrap-restful-format, because it ends up getting passed to both wrap-restful-params and wrap-restful-response, which doesn't work.

In my case, I only need to pass a predicate to wrap-restful-response, so I made that wrap-format-response accept :response-predicate and prefer that over :predicate.

There's probably a better way to solve this issue. I'm open to suggestions.

ninjudd avatar Aug 06 '16 21:08 ninjudd

Just got bitten hard by this issue - LGTM please?

CmdrDats avatar Jan 17 '18 08:01 CmdrDats

The alternative is in format_params.clj:273, the dissoc should also get rid of :predicate because it's entirely not composable. The predicates would need to be per format since it uses them to determine if it should handle the request.

CmdrDats avatar Jan 17 '18 08:01 CmdrDats

@CmdrDats Check https://github.com/metosin/muuntaja

Deraen avatar Jan 17 '18 12:01 Deraen