Skip to content

Commit

Permalink
0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Oct 29, 2014
1 parent 829ab19 commit 0c6b9ad
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
## 0.14.0-SNAPSHOT (x.y.2014)
## 0.14.0 (29.10.2014)

- support for `java.lang.Number`, `java.lang.Integer`, `s/Num`
- Updated deps:
```clojure
[slingshot "0.12.0"] is available but we use "0.10.3"
[slingshot "0.12.1"] is available but we use "0.12.0"
[metosin/ring-http-response "0.5.1"] is available but we use "0.5.0"
[prismatic/plumbing "0.3.5"] is available but we use "0.3.4"
[camel-snake-kebab "0.2.5"] is available but we use "0.2.4"
[potemkin "0.3.11"] is available but we use "0.3.10"
[lein-ring "0.8.13"] is available but we use "0.8.11"
[prismatic/schema "0.3.1"] is available but we use "0.2.6"
[prismatic/plumbing "0.3.4"] is available but we use "0.3.3"
[potemkin "0.3.10"] is available but we use "0.3.8"
```

## 0.13.0 (4.9.2014)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ In namespace `ring.swagger.schema` there are some helpers for creating the schem

| Clojure | JSON Schema | Sample |
| --------|-------|:------------:|
| `Long`, `s/Int` | integer, int64 | `1`|
| `Double` | number, double | `1.2`
| `Integer` | integer, int32 | `1` |
| `Long`, `s/Int` | integer, int64 | `1` |
| `Double`, `Number, `s/Num` | number, double | `1.2`
| `String`, `s/Str`, Keyword, `s/Keyword` | string | `"kikka"`
| `Boolean` | boolean | `true`
| `nil`, `s/Any` | void |
Expand Down
12 changes: 6 additions & 6 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject metosin/ring-swagger "0.14.0-SNAPSHOT"
(defproject metosin/ring-swagger "0.14.0"
:description "Swagger Spec for Ring Apps"
:url "https://github.com/metosin/ring-swagger"
:license {:name "Eclipse Public License"
Expand All @@ -7,16 +7,16 @@
:comments "same as Clojure"}
:dependencies [[org.clojure/clojure "1.6.0"]
[cheshire "5.3.1"]
[slingshot "0.12.0"]
[slingshot "0.12.1"]
[metosin/ring-http-response "0.5.1"]
[prismatic/schema "0.3.1"]
[prismatic/plumbing "0.3.4"]
[prismatic/plumbing "0.3.5"]
[clj-time "0.8.0"]
[camel-snake-kebab "0.2.4"]
[camel-snake-kebab "0.2.5"]
[ring/ring-core "1.3.1"]
[potemkin "0.3.10"]
[potemkin "0.3.11"]
[org.flatland/ordered "1.5.2"]]
:plugins [[lein-ring "0.8.11"]]
:plugins [[lein-ring "0.8.13"]]
:profiles {:dev {:plugins [[lein-clojars "0.9.1"]
[lein-midje "3.1.3"]]
:dependencies [[midje "1.6.3"]
Expand Down
2 changes: 2 additions & 0 deletions src/ring/swagger/json_schema.clj
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@
:items (json-type (first e))})

;; Classes
(defmethod json-type java.lang.Integer [_] {:type "integer" :format "int32"})
(defmethod json-type java.lang.Long [_] {:type "integer" :format "int64"})
(defmethod json-type java.lang.Double [_] {:type "number" :format "double"})
(defmethod json-type java.lang.Number [_] {:type "number" :format "double"})
(defmethod json-type java.lang.String [_] {:type "string"})
(defmethod json-type java.lang.Boolean [_] {:type "boolean"})
(defmethod json-type clojure.lang.Keyword [_] {:type "string"})
Expand Down
5 changes: 4 additions & 1 deletion test/ring/swagger/json_schema_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

(facts "type transformations"
(facts "java types"
(->json Integer) => {:type "integer" :format "int32"}
(->json Long) => {:type "integer" :format "int64"}
(->json Double) => {:type "number" :format "double"}
(->json Number) => {:type "number" :format "double"}
(->json String) => {:type "string"}
(->json Boolean) => {:type "boolean"}
(->json Date) => {:type "string" :format "date-time"}
Expand All @@ -22,7 +24,8 @@

(fact "schema types"
(->json s/Int) => {:type "integer" :format "int64"}
(->json s/Str) => {:type "string"})
(->json s/Str) => {:type "string"}
(->json s/Num) => {:type "number" :format "double"})

(fact "containers"
(->json [Long]) => {:type "array" :items {:format "int64" :type "integer"}}
Expand Down

0 comments on commit 0c6b9ad

Please sign in to comment.