mirror of
https://github.com/metosin/reitit.git
synced 2026-01-08 00:09:50 +00:00
Ring-swagger is not Schema example
This commit is contained in:
parent
1992198b58
commit
c212a7a9fa
1 changed files with 2 additions and 7 deletions
|
|
@ -11,7 +11,6 @@
|
||||||
[reitit.ring.middleware.parameters :as parameters]
|
[reitit.ring.middleware.parameters :as parameters]
|
||||||
;; Uncomment to use
|
;; Uncomment to use
|
||||||
; [reitit.ring.middleware.dev :as dev]
|
; [reitit.ring.middleware.dev :as dev]
|
||||||
[schema-tools.core :as st]
|
|
||||||
[ring.adapter.jetty :as jetty]
|
[ring.adapter.jetty :as jetty]
|
||||||
[muuntaja.core :as m]
|
[muuntaja.core :as m]
|
||||||
[clojure.java.io :as io]))
|
[clojure.java.io :as io]))
|
||||||
|
|
@ -52,18 +51,14 @@
|
||||||
|
|
||||||
["/plus"
|
["/plus"
|
||||||
{:get {:summary "plus with spec query parameters"
|
{:get {:summary "plus with spec query parameters"
|
||||||
:parameters {:query {:x (st/schema int? {:title "X parameter"
|
:parameters {:query {:x int?
|
||||||
:description "Description for X parameter"
|
|
||||||
:json-schema/default 42})
|
|
||||||
:y int?}}
|
:y int?}}
|
||||||
:responses {200 {:body {:total int?}}}
|
:responses {200 {:body {:total int?}}}
|
||||||
:handler (fn [{{{:keys [x y]} :query} :parameters}]
|
:handler (fn [{{{:keys [x y]} :query} :parameters}]
|
||||||
{:status 200
|
{:status 200
|
||||||
:body {:total (+ x y)}})}
|
:body {:total (+ x y)}})}
|
||||||
:post {:summary "plus with spec body parameters"
|
:post {:summary "plus with spec body parameters"
|
||||||
:parameters {:body {:x int? #_(st/schema int? {:name "X parameter"
|
:parameters {:body {:x int?
|
||||||
:description "Description for X parameter"
|
|
||||||
:json-schema/default 42})
|
|
||||||
:y int?}}
|
:y int?}}
|
||||||
:responses {200 {:body {:total int?}}}
|
:responses {200 {:body {:total int?}}}
|
||||||
:handler (fn [{{{:keys [x y]} :body} :parameters}]
|
:handler (fn [{{{:keys [x y]} :body} :parameters}]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue