Skip to content

Commit 9f27501

Browse files
committed
revert
1 parent f553fec commit 9f27501

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

test/ring/swagger/json_schema_test.clj

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,19 @@
150150
))
151151

152152
(fact "Optional-key default metadata"
153-
(rsjs/properties {(with-meta (s/optional-key :foo) {:default "bar"}) s/Str} :swagger)
153+
(rsjs/properties {(with-meta (s/optional-key :foo) {:default "bar"}) s/Str})
154154
=> {:foo {:type "string" :default "bar"}}
155155

156156
(fact "nil default is ignored"
157-
(rsjs/properties {(with-meta (s/optional-key :foo) {:default nil}) s/Str} :swagger)
157+
(rsjs/properties {(with-meta (s/optional-key :foo) {:default nil}) s/Str})
158158
=> {:foo {:type "string"}})
159159

160160
(fact "pfnk schema"
161-
(rsjs/properties (pfnk/input-schema (p/fnk [{x :- s/Str "foo"}])) :swagger)
161+
(rsjs/properties (pfnk/input-schema (p/fnk [{x :- s/Str "foo"}])))
162162
=> {:x {:type "string" :default "foo"}})
163163

164164
(fact "pfnk schema - nil default is ignored"
165-
(rsjs/properties (pfnk/input-schema (p/fnk [{x :- s/Str nil}])) :swagger)
165+
(rsjs/properties (pfnk/input-schema (p/fnk [{x :- s/Str nil}])))
166166
=> {:x {:type "string"}}))
167167

168168
(fact "Describe"
@@ -204,7 +204,7 @@
204204
(rsjs/->swagger schema) => {:$ref "#/definitions/schema"})
205205

206206
(fact "extra metadata is present on schema objects"
207-
(rsjs/schema-object schema :swagger) => (contains
207+
(rsjs/schema-object schema) => (contains
208208
{:properties {:name {:type "string"}
209209
:title {:type "string"}}
210210
:minProperties 1
@@ -228,46 +228,46 @@
228228
(facts "properties"
229229
(fact "s/Any -values are not ignored"
230230
(keys (rsjs/properties {:a s/Str
231-
:b s/Any} :swagger))
231+
:b s/Any}))
232232
=> [:a :b])
233233

234234
(fact "nil-values are ignored"
235-
(keys (rsjs/properties {:a s/Str, :b Currency} :swagger))
235+
(keys (rsjs/properties {:a s/Str, :b Currency}))
236236
=> [:a])
237237

238238
(fact "s/Keyword -keys are ignored"
239239
(keys (rsjs/properties {:a s/Str
240-
s/Keyword s/Str} :swagger))
240+
s/Keyword s/Str}))
241241
=> [:a])
242242

243243
(fact "Class -keys are ignored"
244244
(keys (rsjs/properties {:a s/Str
245-
s/Str s/Str} :swagger))
245+
s/Str s/Str}))
246246
=> [:a])
247247

248248
(fact "Required keyword-keys are used"
249249
(keys (rsjs/properties {:a s/Str
250-
(s/required-key :b) s/Str} :swagger))
250+
(s/required-key :b) s/Str}))
251251
=> [:a :b])
252252

253253
(fact "Required non-keyword-keys are NOT ignored"
254254
(keys (rsjs/properties {:a s/Str
255-
(s/required-key "b") s/Str} :swagger))
255+
(s/required-key "b") s/Str}))
256256
=> [:a "b"])
257257

258258
(fact "s/Any -keys are ignored"
259259
(keys (rsjs/properties {:a s/Str
260-
s/Any s/Str} :swagger))
260+
s/Any s/Str}))
261261
=> [:a])
262262

263263
(fact "with unknown mappings"
264264
(fact "by default, exception is thrown"
265265
(rsjs/properties {:a String
266-
:b java.util.Vector} :swagger) => (throws IllegalArgumentException))
266+
:b java.util.Vector}) => (throws IllegalArgumentException))
267267
(fact "unknown fields are ignored ig *ignore-missing-mappings* is set"
268268
(binding [rsjs/*ignore-missing-mappings* true]
269269
(keys (rsjs/properties {:a String
270-
:b java.util.Vector} :swagger)) => [:a])))
270+
:b java.util.Vector})) => [:a])))
271271

272272
(fact "Keeps the order of properties intact"
273273
(keys (rsjs/properties (linked/map :a String
@@ -277,42 +277,42 @@
277277
:e String
278278
:f String
279279
:g String
280-
:h String) :swagger))
280+
:h String)))
281281
=> [:a :b :c :d :e :f :g :h])
282282

283283
(fact "Ordered-map works with sub-schemas"
284284
(rsjs/properties (rsc/with-named-sub-schemas (linked/map :a String
285285
:b {:foo String}
286-
:c [{:bar String}] )) :swagger)
286+
:c [{:bar String}])))
287287
=> anything)
288288

289289
(fact "referenced record-schemas"
290290
(s/defschema Foo (s/enum :one :two))
291291
(s/defschema Bar {:key Foo})
292292

293293
(fact "can't get properties out of record schemas"
294-
(rsjs/properties Foo :swagger)) => (throws AssertionError)
294+
(rsjs/properties Foo)) => (throws AssertionError)
295295

296296
(fact "nested properties work ok"
297-
(keys (rsjs/properties Bar :swagger)) => [:key])))
297+
(keys (rsjs/properties Bar)) => [:key])))
298298

299299
(facts "additional-properties"
300300
(fact "No additional properties"
301-
(rsjs/additional-properties {:a s/Str} :swagger)
301+
(rsjs/additional-properties {:a s/Str})
302302
=> false)
303303

304304
(fact "s/Keyword"
305-
(rsjs/additional-properties {s/Keyword s/Bool} :swagger)
305+
(rsjs/additional-properties {s/Keyword s/Bool})
306306
=> {:type "boolean"})
307307

308308
(fact "s/Any"
309-
(rsjs/additional-properties {s/Any s/Str} :swagger)
309+
(rsjs/additional-properties {s/Any s/Str})
310310
=> {:type "string"})
311311

312312
(fact "s/Str"
313-
(rsjs/additional-properties {s/Str s/Bool} :swagger)
313+
(rsjs/additional-properties {s/Str s/Bool})
314314
=> {:type "boolean"})
315315

316316
(fact "s/Int"
317-
(rsjs/additional-properties {s/Int s/Str} :swagger)
317+
(rsjs/additional-properties {s/Int s/Str})
318318
=> {:type "string"}))

0 commit comments

Comments
 (0)