Fork me on GitHub
#reitit
<
2021-04-18
>
Ben Sless15:04:30

Hi all, I'm using malli for coercion and sieppari. When requests fail validation the returned body contains the schema and a list of errors. If I wanted to only return the humanized error message, what would be the best way? An interceptor with :leave or is there something slightly more convenient?

bartuka14:04:50

when you create the coercion using reitit.coercion.malli/create there is a :error-keys options that defaults to :error-keys #{:type :coercion :in :schema :value :errors :humanized #_:transformed} I haven't tested, but I believe if you leave only :humanized here it should work

Ben Sless14:04:08

thank you! I'll check it out

👍 3