File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/compojure/api/coercion Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ (ns compojure.api.coercion.core )
2+
3+ (defprotocol Coercion
4+ (get-name [this])
5+ (get-apidocs [this model data])
6+ (make-open [this model])
7+ (encode-error [this error])
8+ (coerce-request [this model value type format request])
9+ (accept-response? [this model])
10+ (coerce-response [this model value type format request]))
11+
12+ (defrecord CoercionError [])
13+
14+ (defmulti named-coercion identity :default ::default )
15+
16+ (defmethod named-coercion ::default [x]
17+ (let [message (if (= :spec x)
18+ (str " spec-coercion is not enabled. "
19+ " you most likely are missing the "
20+ " required deps: org.clojure/clojure 1.9+ "
21+ " and metosin/spec-tools." )
22+ (str " cant find named-coercion for " x))]
23+ (throw (ex-info message {:name x}))))
You can’t perform that action at this time.
0 commit comments