This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-17
Channels
- # beginners (69)
- # calva (25)
- # cider (12)
- # cljdoc (17)
- # cljs-dev (60)
- # clojure (67)
- # clojure-spec (2)
- # clojure-uk (17)
- # clojurescript (46)
- # cloverage (1)
- # code-reviews (6)
- # cursive (3)
- # datascript (8)
- # figwheel-main (1)
- # fulcro (13)
- # hyperfiddle (25)
- # off-topic (7)
- # re-frame (24)
- # reagent (12)
- # reitit (24)
- # ring (8)
- # spacemacs (11)
- # specter (22)
- # tools-deps (7)
- # unrepl (1)
Hello. I'm using reitit 2.7. I'm trying to create nested path with handlers. Can't understand why all intermediate handlers are ignored?
I can invoke only "/test1/test2" handler. Why I can't invoke "/test1" handler?
@mike1452 handlers are request => response
functions, so you can compose them. You should use Interceptors for that, as all the steps are context => ->context
, so you can chain them.
@ikitommi A, thanks. Now I understand the logic.
behind the scenes, all intermediate data is meta-merged into endpoints: Interceptors are defined in vector, and thet get conjoined. handlers are defined as functions, so the last one wins
you can ask the merged final route tree (with data) from the router to see how it looks
Oh, there was a discussion to allow the intermediate paths with handlers to function as endpoints too. Can't remember how it ended. If you wish this, please write an issue.
here is a full example. now, i have handlers on any level, all intermediate interceptors are executed.
also, copied from c-api the new spec error handling: the spec problems will be available in the error handlers, so one can plug in expound, pinpointer or any other spec pretty printer to handle spec errors.
has anyone else had this bug where the body editor part of the Swagger-UI doesn't render?
@robert.mather.rmm have you defined both :coercion
and :parameters
&/ :responses
?
sounds legit. there is a working example in https://github.com/metosin/reitit/blob/master/examples/ring-swagger/src/example/server.clj. hope this helps, going offline now.