reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
Tanel 2020-05-14T08:35:26.404500Z

Hi, does reitit play well with a component library like https://github.com/stuartsierra/component ?

oly 2020-05-14T09:26:18.406900Z

is there a way to make the swagger select box have value attribute which is an id but shows text I am using spec, up until now i have been using a spec with a set of values but the text and value are the same so looking for a way to have separate values.

ikitommi 2020-05-14T10:12:47.407800Z

@oliver.marks don't think so. You could ask from swagger-ui repo via GitHub issue

ikitommi 2020-05-14T10:14:32.408100Z

Yes, it should.

👍 1
oly 2020-05-14T10:46:37.408700Z

okay thanks @ikitommi will see what i can find out

oly 2020-05-14T10:53:34.409400Z

sounds like it may be possible by giving the enums descriptions https://swagger.io/docs/specification/data-models/enums/ can wee do that in reitit swagger currently ?

oly 2020-05-14T10:55:13.409900Z

actually think i am misunderstanding that

oly 2020-05-14T11:08:16.410100Z

I did however come across this with a bit of a discussion https://github.com/OAI/OpenAPI-Specification/issues/681

👍 1
aratare 2020-05-14T12:00:19.410800Z

Hey guys, new guy here so please bear with me. I'm trying to define top-level middleware via the :middleware keyword when creating the ring-handler but keep encountering errors when running the server. Here's what I tried:

(defn wrap-test [handler]
  (fn [req] (handler req)))

(mount/defstate app-routes
  :start
  (ring/ring-handler
    (ring/router
      [...])
    (ring/routes
      ...)
    {:middleware [#(wrap-test %)]))
and I keep getting errors telling me that wrong number of args are being passed into wrap-test. I'm currently using the latest reitit (0.4.2). I can simply wrap the entire ring-handler inside a wrapper and that works just fine, though I wanted to organise things a bit and hence this approach. I got the above code from going through the docs, but have I done something wrong here? Thanks in advance!