reitit/CHANGELOG.md

82 lines
2.5 KiB
Markdown
Raw Normal View History

2018-03-21 05:56:50 +00:00
## 0.1.1-SNAPSHOT
### `reitit-core`
2018-03-21 06:02:49 +00:00
* `match-by-path` encodes parameters into strings using (internal) `reitit.impl/IntoString` protocol. Handles all of: strings, numbers, keywords, booleans, objects. Fixes [#75](https://github.com/metosin/reitit/issues/75).
2018-03-21 05:56:50 +00:00
```clj
(require '[reitit.core :as r])
(r/match-by-name
(r/router
["/coffee/:type" ::coffee])
::coffee
{:type :luwak})
;#Match{:template "/coffee/:type",
; :data {:name :user/coffee},
; :result nil,
; :path-params {:type "luwak"},
2018-03-21 06:02:49 +00:00
; :path "/coffee/luwak"}
2018-03-21 05:56:50 +00:00
```
2018-04-23 05:27:16 +00:00
### `reitit-ring`
* `reitit.ring/default-handler` now works correctly with async ring
* new helper `reitit.ring/router` to compose routes outside of a router.
2018-04-24 18:17:25 +00:00
* `reitit.ring/create-resource-handler` function to serve static routes. See (docs)[https://metosin.github.io/reitit/ring/static.html].
2018-04-23 05:27:16 +00:00
2018-04-25 05:32:01 +00:00
* new dependencies:
```clj
[ring/ring-core "1.6.3"]
```
2018-03-21 05:58:06 +00:00
### `reitit-swagger`
2018-04-24 18:17:25 +00:00
* New module to produce swagger-docs from routing tree, including `Coercion` definitions. Works with both middleware & interceptors and Schema & Spec. See [docs](https://metosin.github.io/reitit/swagger.html).
2018-03-21 05:58:06 +00:00
```clj
(require '[reitit.ring :as ring])
(require '[reitit.swagger :as swagger])
(require '[reitit.ring.coercion :as rrc])
(require '[reitit.coercion.spec :as spec])
(require '[reitit.coercion.schema :as schema])
(require '[schema.core :refer [Int]])
(ring/ring-handler
(ring/router
["/api"
{:swagger {:id ::math}}
["/swagger.json"
{:get {:no-doc true
:swagger {:info {:title "my-api"}}
:handler (swagger/create-swagger-handler)}}]
2018-03-21 05:58:06 +00:00
["/spec" {:coercion spec/coercion}
["/plus"
{:get {:summary "plus"
:parameters {:query {:x int?, :y int?}}
:responses {200 {:body {:total int?}}}
:handler (fn [{{{:keys [x y]} :query} :parameters}]
{:status 200, :body {:total (+ x y)}})}}]]
["/schema" {:coercion schema/coercion}
["/plus"
{:get {:summary "plus"
:parameters {:query {:x Int, :y Int}}
:responses {200 {:body {:total Int}}}
:handler (fn [{{{:keys [x y]} :query} :parameters}]
{:status 200, :body {:total (+ x y)}})}}]]]
{:data {:middleware [rrc/coerce-exceptions-middleware
rrc/coerce-request-middleware
rrc/coerce-response-middleware
swagger/swagger-feature]}}))
```
2018-02-19 05:44:29 +00:00
## 0.1.0 (2018-2-19)
2017-08-07 11:08:39 +00:00
2018-02-19 05:44:29 +00:00
* First release