Skip to content

Commit dd4b9c3

Browse files
committed
update docs, bump up version
1 parent b522be2 commit dd4b9c3

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## 0.19.0-SNAPSHOT (xx.3.2015)
1+
## 0.19.0 (28.3.2015)
22

33
- added destructuring for `:headers`, thanks to [tchagnon](https://github.com/tchagnon)!
4-
- **BREAKING**: `:path-param` doesn't use force models to be strict, needed for the `context*
5-
- **BREAKING**: parameters are collected in (Ring-)Swagger 2.0 format, might break client-side restructurings. see https://github.com/metosin/ring-swagger/blob/master/test/ring/swagger/swagger2_test.clj
4+
- `:path-param` doesn't use force models to be strict, needed for the partial parameter matching in `context*`
5+
- **BREAKING**: parameters are collected in (Ring-)Swagger 2.0 format, might break client-side restructurings. see https://github.com/metosin/ring-swagger/blob/master/test/ring/swagger/swagger2_test.clj & https://github.com/metosin/compojure-api/blob/master/src/compojure/api/meta.clj for examples of the new models
66
- `context*` to allow setting meta-data to mid-routes. Mid-route meta-data are deep-merged into endpoint swagger-definitions at compile-time. At runtime, code is executed in place.
77

88
```clojure

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,19 @@ Stuff on top of [Compojure](https://github.com/weavejester/compojure) for making
8989
:return Thingie
9090
:body [thingie Thingie]
9191
:summary "echoes a Thingie from json-body"
92-
(ok thingie)))))
92+
(ok thingie))
93+
94+
(swaggered "context*"
95+
:description "context* routes"
96+
(context* "/context/:kikka" []
97+
:summary "summary inherited from context"
98+
:path-params [kikka :- s/Str]
99+
:query-params [kukka :- s/Str]
100+
(GET* "/:kakka" []
101+
:path-params [kakka :- s/Str]
102+
(ok {:kikka kikka
103+
:kukka kukka
104+
:kakka kakka})))))))
93105
```
94106

95107
To try it yourself, clone this repository and type
@@ -172,7 +184,7 @@ supported content-type into request under keys `[:meta :consumes]` and `[:meta :
172184

173185
## Routes
174186

175-
You can use [vanilla Compojure routes](https://github.com/weavejester/compojure/wiki) or their enhanced versions from `compojure.api.core`. Enhanced versions have `*` in their name (`GET*`, `POST*`, `defroutes*` etc.) so that they don't get mixed up with the originals. Enhanced version can be used exactly as their ancestors but have also new behavior, more on that later.
187+
You can use [vanilla Compojure routes](https://github.com/weavejester/compojure/wiki) or their enhanced versions from `compojure.api.core`. Enhanced versions have `*` in their name (`GET*`, `POST*`, `context*`, `defroutes*` etc.) so that they don't get mixed up with the originals. Enhanced version can be used exactly as their ancestors but have also new behavior, more on that later.
176188

177189
Namespace `compojure.api.sweet` is a public entry point for all routing - importing Vars from `compojure.api.core`, `compojure.api.swagger` and `compojure.core`.
178190

@@ -186,7 +198,7 @@ There is also `compojure.api.legacy` namespace which contains rest of the public
186198
[compojure.api.sweet :refer :all]))
187199

188200
(defapi app
189-
(context "/api" []
201+
(context* "/api" []
190202
(GET* "/user/:id" [id] (ok {:id id}))
191203
(POST* "/echo" {body :body-params} (ok body))))
192204
```

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.19.0-SNAPSHOT"
1+
(defproject metosin/compojure-api "0.19.0"
22
:description "Compojure Api"
33
:url "https://github.com/metosin/compojure-api"
44
:license {:name "Eclipse Public License"

0 commit comments

Comments
 (0)