mirror of
https://github.com/metosin/reitit.git
synced 2025-12-30 13:18:25 +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]
|
||||
;; Uncomment to use
|
||||
; [reitit.ring.middleware.dev :as dev]
|
||||
[schema-tools.core :as st]
|
||||
[ring.adapter.jetty :as jetty]
|
||||
[muuntaja.core :as m]
|
||||
[clojure.java.io :as io]))
|
||||
|
|
@ -52,18 +51,14 @@
|
|||
|
||||
["/plus"
|
||||
{:get {:summary "plus with spec query parameters"
|
||||
:parameters {:query {:x (st/schema int? {:title "X parameter"
|
||||
:description "Description for X parameter"
|
||||
:json-schema/default 42})
|
||||
:parameters {:query {:x int?
|
||||
:y int?}}
|
||||
:responses {200 {:body {:total int?}}}
|
||||
:handler (fn [{{{:keys [x y]} :query} :parameters}]
|
||||
{:status 200
|
||||
:body {:total (+ x y)}})}
|
||||
:post {:summary "plus with spec body parameters"
|
||||
:parameters {:body {:x int? #_(st/schema int? {:name "X parameter"
|
||||
:description "Description for X parameter"
|
||||
:json-schema/default 42})
|
||||
:parameters {:body {:x int?
|
||||
:y int?}}
|
||||
:responses {200 {:body {:total int?}}}
|
||||
:handler (fn [{{{:keys [x y]} :body} :parameters}]
|
||||
|
|
|
|||
Loading…
Reference in a new issue