将基于角色的身份验证添加到compojure api之后,覆盖失败。运行lein cloverage
时遇到此异常:
Exception in thread "main" java.lang.IllegalArgumentException: No method in multimethod 'restructure-param' for dispatch value: :auth-roles, compiling:(/private/var/folders/w_/yt926bqs21g44f257yz05ctsjbv948/T/form-init3368607975292148784.clj:1:125)
这是我的身份验证中间件:
(defmethod compojure.api.meta/restructure-param :auth-roles
[_ required-roles acc]
(update-in acc [:middleware] conj [require-roles required-roles]))
答案 0 :(得分:0)
请参阅github问题:https://github.com/cloverage/cloverage/issues/164#issuecomment-281673566
(defmethod compojure.api.meta/restructure-param :auth-roles
[_ required-roles acc]
(update-in acc [:middleware] conj [`require-roles required-roles]))