Ring-swagger is not Schema example

This commit is contained in:
Juho Teperi 2021-03-11 21:56:22 +02:00
parent 1992198b58
commit c212a7a9fa

View file

@ -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}]