Skip to content

Commit 5619e23

Browse files
committed
Use ring.swagger.validator
1 parent 8f244e9 commit 5619e23

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

project.clj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
[peridot "0.4.2"]
3535
[javax.servlet/servlet-api "2.5"]
3636
[midje "1.8.3"]
37-
[metosin/scjsv "0.2.0"]
3837
[com.stuartsierra/component "0.3.1"]
3938
[reloaded.repl "0.2.1"]
4039
[http-kit "2.1.19"]

test/compojure/api/sweet_test.clj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
[ring.mock.request :refer :all]
66
[schema.core :as s]
77
[clojure.java.io :as io]
8-
[scjsv.core :as scjsv]
8+
[ring.swagger.validator :as v]
99
[compojure.api.routes :as routes]))
1010

11-
(def validate
12-
(scjsv/validator (slurp (io/resource "ring/swagger/v2.0_schema.json"))))
13-
1411
(s/defschema Band {:id s/Int
1512
:name s/Str
1613
(s/optional-key :description) (s/maybe s/Str)
@@ -193,4 +190,4 @@
193190
:required ["name" "toppings"]}}})
194191

195192
(fact "spec is valid"
196-
(validate body) => nil))))
193+
(v/validate body) => nil))))

0 commit comments

Comments
 (0)