This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-19
Channels
- # adventofcode (4)
- # beginners (80)
- # boot (4)
- # cbus (2)
- # cider (62)
- # clara (18)
- # cljs-dev (8)
- # cljsrn (10)
- # clojure (139)
- # clojure-brasil (3)
- # clojure-dev (27)
- # clojure-italy (1)
- # clojure-russia (3)
- # clojure-spec (4)
- # clojure-uk (47)
- # clojurescript (102)
- # core-async (10)
- # cursive (7)
- # datomic (71)
- # emacs (32)
- # fulcro (99)
- # funcool (1)
- # hoplon (3)
- # jobs (1)
- # jobs-discuss (6)
- # jobs_rus (2)
- # leiningen (3)
- # luminus (2)
- # lumo (14)
- # mount (7)
- # off-topic (19)
- # re-frame (25)
- # ring-swagger (4)
- # rum (3)
- # shadow-cljs (142)
- # specter (2)
- # sql (16)
- # timbre (1)
- # vim (3)
Anyone able to help me understand why my path param isn’t being coerced to a int like i would expect? It also validate (complain) if the input can’t be coerced to an int.
(s/def ::id spec/int?)
(def app
(api
{:coercion :spec
:swagger
{:ui "/"
:spec "/swagger.json"
:data {:info {:title "ResoluteAPI"
:description "API endpoint around customer portfolios"}
:tags [{:name "Equipments", :description "A api for the equipments page"}]}}}
(context "/api" []
:tags ["api"]
(GET "/equipment/:equipment-id/points" []
:return ::points
:path-params [equipment-id :- ::id]
:summary "returns all points for a given equipment"
(ok {:hi equipment-id})))))
(-> {:uri "/api/equipment/3/points"
:request-method :get}
app
:body
slurp
(cheshire.core/parse-string true))
;;{:hi "3"}
updated the deps and everything works fine
how do I set an example request body in a compojure-api endpoint?
I have seen it before, but I can’t remember