This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-03
Channels
- # arachne (1)
- # beginners (75)
- # calva (7)
- # cider (1)
- # clj-kondo (6)
- # cljdoc (3)
- # clojure (74)
- # clojure-brasil (2)
- # clojure-china (6)
- # clojure-italy (16)
- # clojure-nl (1)
- # clojure-spec (23)
- # clojure-uk (5)
- # clojurebridge (1)
- # clojuredesign-podcast (8)
- # clojurescript (4)
- # community-development (1)
- # data-science (1)
- # datavis (1)
- # datomic (5)
- # duct (18)
- # graalvm (2)
- # kaocha (3)
- # onyx (3)
- # other-languages (1)
- # pathom (4)
- # reagent (61)
- # reitit (5)
- # shadow-cljs (8)
- # tools-deps (11)
- # vim (1)
sorry if it's a dumb question, but how would you represent this compojure route
(POST "/register" req
:return Result
:body [user UserRegistration]
:summary "register a new user"
(auth/register! req user)))
in reitit-swagger? I'm new to clojure and I'm following a tutorial, but I'm stuck at creating a new service route in reitit (tutorial does it with compojure)
here's my code:I'd suggest to double check the :coercion spec-coercion/coercion
and :parameters {:body UserRegistration}
lines. In the former it looks like you are using spec instead of schema coercion; in the latter I think you may be missing the parameter name..
Take a look to this excerpt from the docs:
(require '[reitit.coercion.schema])
(require '[schema.core :as s])
(def router
(r/router
["/:company/users/:user-id" {:name ::user-view
:coercion reitit.coercion.schema/coercion
:parameters {:path {:company s/Str
:user-id s/Int}}}]))
(see Define coercion and Defining parameters sections on the docs https://metosin.github.io/reitit/coercion/coercion.html)
Hope that helps