Coercers aren't really amenable to this at the moment, and use a memoized cache to get around this limitation (but given that equivalent Schema's are often not equal, might not be totally effective), but the idea is:
(context "/foo" req
(GET "/" []
:body [body :- MySchema]
...))
=>
(let [coercer (cache-coercion s/Int)]
(context "/foo" req
(GET "/" []
:body [body :- coercer]
...))
Or perhaps an even more general optimization that would cache all sorts of things like merge-parameters and all the other args to routes/map->Route and the route itself, even under a dynamic context.
(let [rs (GET "/" []
:body [body :- coercer]
...)]
(context "/foo" req
rs))