Skip to content

Commit d0125bf

Browse files
committed
0.21.0 is out!
1 parent 4269293 commit d0125bf

File tree

3 files changed

+5
-38
lines changed

3 files changed

+5
-38
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 0.21.0
1+
## 0.21.0 (25.5.2015)
22

33
* `:multipart-params` now sets `:consumes ["multipart/form-data"]` and `:form-params` sets
44
`:consumes ["application/x-www-form-urlencoded"]`
@@ -68,7 +68,9 @@
6868
* updated dependencies:
6969

7070
```clojure
71+
[metosin/ring-swagger "0.20.4"] is available but we use "0.20.3"
7172
[metosin/ring-http-response "0.6.2"] is available but we use "0.6.1"
73+
[metosin/ring-swagger-ui "2.1.5-M2"]
7274
[prismatic/plumbing "0.4.4"] is available but we use "0.4.3"
7375
[prismatic/schema "0.4.3"] is available but we use "0.4.2"
7476
```

README.md

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -518,42 +518,7 @@ app supports), opposed to the [Ring Spec](https://github.com/mmcgrana/ring/blob/
518518
(ok (str "hello, " name))))
519519
```
520520

521-
## Response-models (pre 0.21.0)
522-
523-
Key `:responses` takes a map of http-status-code -> model map, which translates to both return model coercion and
524-
to swagger `responseMessages` description. Models can be decorated with `:message` meta-data.
525-
526-
```clojure
527-
(GET* "/" []
528-
:query-params [return :- (s/enum :200 :403 :404)]
529-
:responses {403 (with-meta {:code s/Str} {:message "spiders?"})
530-
404 (with-meta {:reason s/Str} {:message "lost?"})}
531-
:return Total
532-
:summary "multiple returns models"
533-
(case return
534-
:200 (ok {:total 42})
535-
:403 (forbidden {:code "forest"})
536-
:404 (not-found {:reason "lost"})))
537-
```
538-
539-
The `:return` maps the model just to the response 200, so one can also say:
540-
541-
```clojure
542-
(GET* "/" []
543-
:query-params [return :- (s/enum :200 :403 :404)]
544-
:responses {200 (with-meta Total {:message "happy path"})
545-
403 (with-meta {:code s/Str} {:message "spiders?"})
546-
404 (with-meta {:reason s/Str} {:message "lost?"})}
547-
:summary "multiple returns models"
548-
(case return
549-
:200 (ok {:total 42})
550-
:403 (forbidden {:code "forest"})
551-
:404 (not-found {:reason "lost"})))
552-
```
553-
554-
## Response-models (post 0.21.0)
555-
556-
This stuff works with `0.21.0-SNAPSHOT`.
521+
## Response-models
557522

558523
Key `:responses` takes a map of http-status-code to schema-definitions map
559524
(with optional `:schema`, `:description` and `:headers` keys). `:schema` defines the return model

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[prismatic/schema "0.4.3"]
1414
[org.tobereplaced/lettercase "1.0.0"]
1515
[metosin/ring-http-response "0.6.2"]
16-
[metosin/ring-swagger "0.20.4-SNAPSHOT"]
16+
[metosin/ring-swagger "0.20.4"]
1717
[metosin/ring-middleware-format "0.6.0"]
1818
[backtick "0.3.2"]
1919
[metosin/ring-swagger-ui "2.1.5-M2"]]

0 commit comments

Comments
 (0)