Skip to content

Commit 3688da2

Browse files
committed
polish README, bump up version
1 parent 216411e commit 3688da2

File tree

3 files changed

+37
-22
lines changed

3 files changed

+37
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## x.xx.x
1+
## 0.20.1 (26.4.2015)
22

3+
- `swagger-json` now handles `nil` options, thanks to [Frankie Sardo](https://github.com/frankiesardo).
34
- updated dependencies:
45
```clojure
56
[prismatic/schema "0.4.1"] is available but we use "0.4.0"

README.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626
- [pedastal-swagger](https://github.com/frankiesardo/pedestal-swagger) for Pedastal
2727
- [rook](https://github.com/AvisoNovate/rook)
2828

29-
Route definitions as expected as a clojure Map defined by the [Schema](https://github.com/metosin/ring-swagger/blob/master/src/ring/swagger/swagger2_schema.clj).
30-
The Schema is open as ring-swagger tries not to be on your way - one can always pass any extra data in the Swagger Spec format. The generated specs can be validated against
31-
the [Swagger Schema](https://raw.githubusercontent.com/reverb/swagger-spec/master/schemas/v2.0/schema.json) via tools like
32-
[scjsv](https://github.com/metosin/scjsv).
29+
Route definitions as expected as a clojure Map defined by the [Schema](https://github.com/metosin/ring-swagger/blob/master/src/ring/swagger/swagger2_schema.clj). The Schema is open as ring-swagger tries not to be on your way - one can always pass any extra data in the Swagger Spec format.
3330

3431
### Simplest possible example
3532

@@ -58,23 +55,38 @@ the [Swagger Schema](https://raw.githubusercontent.com/reverb/swagger-spec/maste
5855
:address {:street s/Str
5956
:city (s/enum :tre :hki)}})
6057

61-
(rs/swagger-json {:info {:title "Cool API"
62-
:contact {:email "my@example.com"}}
63-
:tags [{:name "user"
64-
:description "User stuff"}]
65-
:paths {"/api/ping" {:get nil}
66-
"/user/:id" {:post {:summary "User Api"
67-
:description "User Api description"
68-
:tags ["user"]
69-
:parameters {:path {:id s/Str}
70-
:body User}
71-
:responses {200 {:schema User
72-
:description "Found it!"}
73-
404 {:description "Ohnoes."}}}}}})
58+
(s/with-fn-validation
59+
(rs/swagger-json
60+
{:info {:version "1.0.0"
61+
:title "Sausages"
62+
:description "Sausage description"
63+
:termsOfService "http://helloreverb.com/terms/"
64+
:contact {:name "My API Team"
65+
:email "foo@example.com"
66+
:url "http://www.metosin.fi"}
67+
:license {:name "Eclipse Public License"
68+
:url "http://www.eclipse.org/legal/epl-v10.html"}}
69+
:tags [{:name "user"
70+
:description "User stuff"}]
71+
:paths {"/api/ping" {:get nil}
72+
"/user/:id" {:post {:summary "User Api"
73+
:description "User Api description"
74+
:tags ["user"]
75+
:parameters {:path {:id s/Str}
76+
:body User}
77+
:responses {200 {:schema User
78+
:description "Found it!"}
79+
404 {:description "Ohnoes."}}}}}}))
7480
; {:swagger "2.0"
75-
; :info {:title "Cool API"
76-
; :version "0.0.1"
77-
; :contact {:email "my@example.com"}}
81+
; :info {:version "1.0.0"
82+
; :title "Sausages"
83+
; :description "Sausage description"
84+
; :termsOfService "http://helloreverb.com/terms/"
85+
; :contact {:email "foo@example.com"
86+
; :name "My API Team"
87+
; :url "http://www.metosin.fi"}
88+
; :license {:name "Eclipse Public License"
89+
; :url "http://www.eclipse.org/legal/epl-v10.html"}}
7890
; :produces ["application/json"]
7991
; :consumes ["application/json"]
8092
; :paths {"/api/ping" {:get {:responses {:default {:description ""}}}}
@@ -105,6 +117,8 @@ the [Swagger Schema](https://raw.githubusercontent.com/reverb/swagger-spec/maste
105117

106118
### validating the results
107119

120+
The generated full spec can be validated against the [Swagger JSON Schema](https://raw.githubusercontent.com/reverb/swagger-spec/master/schemas/v2.0/schema.json) via tools like [scjsv](https://github.com/metosin/scjsv).
121+
108122
```clojure
109123
(require '[scjsv.core :as scjsv])
110124

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(defproject metosin/ring-swagger "0.20.0"
1+
(defproject metosin/ring-swagger "0.20.1"
22
:description "Swagger Spec for Ring Apps"
33
:url "https://github.com/metosin/ring-swagger"
44
:license {:name "Eclipse Public License"

0 commit comments

Comments
 (0)