metosin/reitit

Option to disable only output validation, not all validation

Open

#602 创建于 2023年3月24日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Clojure (261 fork)batch import
enhancementhelp wanted

仓库指标

Star
 (1,569 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

If I go to reitit.coercion.malli and create my coercion middleware then I can pass :validate option which would enable the validation on input and output of the endpoints. But if I'd want to only disable it for output and still include it in the Swagger spec I can't do it.

I think it would be a good idea to have the :validate option to not use a boolean but instead have it as a map:

:validate {:encode true, :decode true}

What do you think?

It would also be good to expose it as a map from calling create function and not hacking through by copying the code.

贡献者指南