From af2602e326d7349d8bd577ee23170c5da695c28c Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Thu, 11 Sep 2014 19:46:06 +0300 Subject: [PATCH] Release 0.16.2 --- CHANGELOG.md | 4 ++++ project.clj | 2 +- test/compojure/api/core_integration_test.clj | 19 +++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efcb1bbf..38a27871 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/project.clj b/project.clj index defecc1e..8d1bdda8 100644 --- a/project.clj +++ b/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" diff --git a/test/compojure/api/core_integration_test.clj b/test/compojure/api/core_integration_test.clj index be902be7..889cb223 100644 --- a/test/compojure/api/core_integration_test.clj +++ b/test/compojure/api/core_integration_test.clj @@ -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)