Skip to content

Commit

Permalink
parameters-middleware & polish sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Sep 7, 2018
1 parent 7ecc217 commit 1094e7d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/ring-swagger/src/example/server.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[reitit.ring.middleware.muuntaja :as muuntaja]
[reitit.ring.middleware.exception :as exception]
[reitit.ring.middleware.multipart :as multipart]
[ring.middleware.params :as params]
[reitit.ring.middleware.parameters :as parameters]
[ring.adapter.jetty :as jetty]
[muuntaja.core :as m]
[clojure.java.io :as io]))
Expand All @@ -17,7 +17,8 @@
(ring/router
[["/swagger.json"
{:get {:no-doc true
:swagger {:info {:title "my-api"}}
:swagger {:info {:title "my-api"
:description "with reitit-ring"}}
:handler (swagger/create-swagger-handler)}}]

["/files"
Expand All @@ -38,8 +39,9 @@
:handler (fn [_]
{:status 200
:headers {"Content-Type" "image/png"}
:body (io/input-stream
(io/resource "reitit.png"))})}}]]
:body (-> "reitit.png"
(io/resource)
(io/input-stream))})}}]]

["/math"
{:swagger {:tags ["math"]}}
Expand All @@ -61,7 +63,7 @@
{:data {:coercion reitit.coercion.spec/coercion
:muuntaja m/instance
:middleware [;; query-params & form-params
params/wrap-params
parameters/parameters-middleware
;; content-negotiation
muuntaja/format-negotiate-middleware
;; encoding response body
Expand Down

0 comments on commit 1094e7d

Please sign in to comment.