reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
2020-09-26T07:15:50.009900Z

Found my error. Failing to insure the proper placement of the final map in the route definition. I think that’s a record time lost for me to an off by one level in my parens. Sorry if anyone has lost any time to this.

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"].

ikitommi 2020-09-26T13:18:02.011800Z

pushed out [metosin/reitit "0.5.6"] , with latest malli & spec-tools (in preparing initial malli release)

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

fantastico!

Eyal H 2020-09-26T19:50:54.013700Z

Question regarding reitit coercion integration: is there a way to avoid throwing an exception when the validation fails? it seems to me that it carries out some performance penalty