reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
dharrigan 2020-09-20T18:27:34.040800Z

@ikitommi would you consider allowing humanized as the key that is output when there are errors, to be changed to a user-defined one (defaulting to humanized if the opts map entry is missing?)

ikitommi 2020-09-26T13:01:34.010300Z

sure, there is now a option :encode-error that can have a fn of type error -> error, called last to optionally fully rewrite the error.

ikitommi 2020-09-26T13:02:07.010500Z

{:encode-error (fn [error] {:errors (:humanized error)})}
==>
{:status 400, :body {:errors {:x ["missing required key"]}}}'

ikitommi 2020-09-26T13:17:24.011200Z

shipped in [metosin/reitit "0.5.6"].

dharrigan 2020-09-26T15:03:59.011900Z

fantastico!