Skip to content

Commit af2602e

Browse files
committed
Release 0.16.2
1 parent 888ca60 commit af2602e

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.16.2 (11.9.2014)
2+
3+
- Fixed #47: `:middlewares` broke route parameters
4+
15
## 0.16.1 (11.9.2014)
26

37
- Compiled without AOT

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject metosin/compojure-api "0.16.1"
1+
(defproject metosin/compojure-api "0.16.2"
22
:description "Compojure Api"
33
:url "https://github.com/metosin/compojure-api"
44
:license {:name "Eclipse Public License"

test/compojure/api/core_integration_test.clj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,25 @@
478478
:type "void"}]
479479
:path "/user"}]})))
480480

481+
(fact "swagger-docs works with the :middlewares"
482+
(defapi api
483+
(swagger-docs)
484+
(swaggered +name+
485+
(GET* "/middleware" []
486+
:query-params [x :- String]
487+
:middlewares [(constant-middleware (ok 1))]
488+
(ok 2))))
489+
490+
(fact "api-docs"
491+
(let [[status body] (get* api (str "/api/api-docs/" +name+) {})]
492+
status => 200
493+
(-> body :apis first :operations first :parameters first) =>
494+
{:description ""
495+
:name "x"
496+
:paramType "query"
497+
:required true
498+
:type "string"})))
499+
481500
(fact "sub-context paths"
482501
(let [response {:ping "pong"}
483502
ok (ok response)

0 commit comments

Comments
 (0)