Skip to content

Commit 6d705dd

Browse files
author
Miikka Koskinen
committed
Fix empty spec response coercion to mirror schema
Fixes metosin#413.
1 parent 196fa1c commit 6d705dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compojure/api/coercion.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
(satisfies? cc/Coercion coercion) coercion
2525
:else (throw (ex-info (str "invalid coercion " coercion) {:coercion coercion}))))
2626

27-
(defn get-apidocs [mayby-coercion spec info]
28-
(if-let [coercion (resolve-coercion mayby-coercion)]
27+
(defn get-apidocs [maybe-coercion spec info]
28+
(if-let [coercion (resolve-coercion maybe-coercion)]
2929
(cc/get-apidocs coercion spec info)))
3030

3131
(defn coerce-request! [model in type keywordize? open? request]

src/compojure/api/coercion/spec.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
(into
102102
(empty responses)
103103
(for [[k response] responses]
104-
[k (update response :schema maybe-memoized-specify)])))))
104+
[k (update response :schema #(some-> % maybe-memoized-specify))])))))
105105

106106
(make-open [_ spec] spec)
107107

0 commit comments

Comments
 (0)