This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-26
Channels
- # announcements (10)
- # asami (15)
- # babashka (200)
- # beginners (48)
- # calva (56)
- # cider (6)
- # clara (2)
- # cljs-dev (18)
- # cljsrn (6)
- # clojars (3)
- # clojure (23)
- # clojure-czech (2)
- # clojure-europe (41)
- # clojure-germany (5)
- # clojure-italy (19)
- # clojure-nl (5)
- # clojure-uk (8)
- # clojurescript (60)
- # clojureverse-ops (5)
- # cursive (14)
- # datomic (6)
- # events (1)
- # figwheel-main (5)
- # graalvm (17)
- # honeysql (2)
- # instaparse (1)
- # integrant (9)
- # jobs (5)
- # music (2)
- # off-topic (37)
- # other-languages (1)
- # pathom (10)
- # proletarian (5)
- # quil (3)
- # reagent (39)
- # reitit (4)
- # remote-jobs (3)
- # reveal (6)
- # rum (9)
- # shadow-cljs (27)
- # vrac (3)
- # xtdb (5)
How could I add swagger parameter description to :parameters :query?
"parameters":[{"in":"query","name":"street","description":"","type":"string","required":true},{"in":"query","name":"city","description":"","type":"string","required":true,"enum":["tre","hki"]}
(s/def ::city #{:tre :hki})
(s/def ::address (s/keys :req-un [::street ::city]))
["/test"
{:get {:parameters {:query ::address}
:handler (fn [] (constantly (ok)))}}]
Hello 👋 , I’m new to reitit and have a basic question: how does one integrate format negotiation with request coercion? They seem to be at odds with one another. For example, say I have a PUT
endpoint that can accept both application/json
in the body, or x-www-form-urlencoded
. How does one specify this in the :parameters
map so that coercion is applied correctly in both cases? https://cljdoc.org/d/metosin/reitit/0.5.12/doc/ring/pluggable-coercion, the :parameters
map forces you to know a priori where the incoming payload is located, e.g. in the :body
, or in the :form
, etc
You would need to specify coercion in both places, here is a small example
:put {:handler ...
:middleware ...
:parameters {:path {:recipe-id string?}
:body {:name string? :prep-time number? :public boolean? :img string?}}
:responses ...}
:summary "Update recipe"}
The coercion is done with coercion spec. Hope it helps