Navigation Menu

Skip to content

Commit

Permalink
Release 0.16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Deraen committed Sep 11, 2014
1 parent 888ca60 commit af2602e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,7 @@
## 0.16.2 (11.9.2014)

- Fixed #47: `:middlewares` broke route parameters

## 0.16.1 (11.9.2014)

- Compiled without AOT
Expand Down
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject metosin/compojure-api "0.16.1"
(defproject metosin/compojure-api "0.16.2"
:description "Compojure Api"
:url "https://github.com/metosin/compojure-api"
:license {:name "Eclipse Public License"
Expand Down
19 changes: 19 additions & 0 deletions test/compojure/api/core_integration_test.clj
Expand Up @@ -478,6 +478,25 @@
:type "void"}]
:path "/user"}]})))

(fact "swagger-docs works with the :middlewares"
(defapi api
(swagger-docs)
(swaggered +name+
(GET* "/middleware" []
:query-params [x :- String]
:middlewares [(constant-middleware (ok 1))]
(ok 2))))

(fact "api-docs"
(let [[status body] (get* api (str "/api/api-docs/" +name+) {})]
status => 200
(-> body :apis first :operations first :parameters first) =>
{:description ""
:name "x"
:paramType "query"
:required true
:type "string"})))

(fact "sub-context paths"
(let [response {:ping "pong"}
ok (ok response)
Expand Down

0 comments on commit af2602e

Please sign in to comment.