diff --git a/modules/reitit-malli/src/reitit/coercion/malli.cljc b/modules/reitit-malli/src/reitit/coercion/malli.cljc index d8fbd663..44c35c27 100644 --- a/modules/reitit-malli/src/reitit/coercion/malli.cljc +++ b/modules/reitit-malli/src/reitit/coercion/malli.cljc @@ -128,7 +128,7 @@ ([] (create nil)) ([opts] - (let [{:keys [transformers lite compile options error-keys encode-error] :as opts} (merge default-options opts) + (let [{:keys [transformers lite compile options error-keys encode-error humanize-opts] :as opts} (merge default-options opts) show? (fn [key] (contains? error-keys key)) ;; Query-string-coercer needs to construct transfomer without strip-extra-keys so it will ;; use the transformer-provider directly. @@ -188,7 +188,8 @@ (-open-model [_ schema] schema) (-encode-error [_ error] (cond-> error - (show? :humanized) (assoc :humanized (me/humanize error {:wrap :message})) + (show? :humanized) (assoc :humanized (me/humanize error (cond-> {:wrap :message} + humanize-opts (merge humanize-opts)))) (show? :schema) (update :schema edn/write-string opts) (show? :errors) (-> (me/with-error-messages opts) (update :errors (partial map #(update % :schema edn/write-string opts))))