Skip to content

Commit fd80562

Browse files
committed
Fix spec type-resolver names
1 parent d046636 commit fd80562

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/compojure/api/coercion/spec.clj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
(st/type-transformer
1717
st/string-transformer
1818
st/strip-extra-keys-transformer
19-
{:name :strict-string}))
19+
{:name :string}))
2020

2121
(def json-transformer
2222
(st/type-transformer
2323
st/json-transformer
2424
st/strip-extra-keys-transformer
25-
{:name :strict-json}))
25+
{:name :json}))
2626

27-
(def default-transformer
28-
(st/type-transformer))
27+
(defn default-transformer
28+
([] (default-transformer :default))
29+
([name] (st/type-transformer {:name name})))
2930

3031
(defprotocol Specify
3132
(specify [this name]))
@@ -134,12 +135,15 @@
134135
(cc/coerce-request this spec value type format request)))
135136

136137
(def default-options
137-
{:body {:default default-transformer
138+
{:body {:default (default-transformer)
138139
:formats {"application/json" json-transformer
139140
"application/msgpack" json-transformer
140141
"application/x-yaml" json-transformer}}
141142
:string {:default string-transformer}
142-
:response {:default default-transformer}})
143+
:response {:default (default-transformer)
144+
:formats {"application/json" (default-transformer :json)
145+
"application/msgpack" (default-transformer :json)
146+
"application/x-yaml" (default-transformer :json)}}})
143147

144148
(defn create-coercion [options]
145149
(->SpecCoercion :spec options))

0 commit comments

Comments
 (0)