Hi, Has anyone had problems with Swagger-ui functionality with reitit? We have modified our api to use reitit as demonstrated in this example: https://github.com/metosin/reitit/blob/master/examples/http-swagger/src/example/server.clj (not generating swagger.json though but otherwise) Swagger-ui gets generated and looks nice, but every "Try it out + Execute" button push through Swagger ui results to nothing. The ui looks exactly the same as before pushing the buttons. When I look from the browser console, the requests get executed and get a response. What could be the issue?
They have the same hostname yes. Weird. 🙂 Another question, if there are both interceptors and middleware, which one is executed last? We have existing api with middleware that formats the response and attaches wanted headers etc. If I add interceptors, it looks like the middleware does nothing 🤔
let me check the implementation...
is this reitit-ring? I don't see interceptor support there
I was using this example as a reference, this has interceptors: https://github.com/metosin/reitit/blob/master/examples/http-swagger/src/example/server.clj
yeah, that's using reitit.http, and interceptors & sieppari
you probably want one of the ring examples like https://github.com/metosin/reitit/tree/master/examples/ring-malli-swagger
Ahh, fudge 😅
I don't know if anyone actually uses the reitit.http stuff. The naming is a bit unfortunate. At least I only ever use reitit.ring.
I guess some people are using pedestal and they might be using reitit.http
Sounds weird. I don't really have any good ideas... Could it be something like CORS that's preventing JS from seeing the response? Are you serving swagger-ui on the same hostname as the API?
Does Reitit have a way for doing coercion to cookies? I’ve been looking through docs and haven’t seen anything. It’s simple to create my own custom middleware to do what I want, but just figured Reitit might have addressed it first.
OK, thanks. I’m not blind then. 🙂 ring.middleware.cookies does have :encoder and :decoder options that I can use.
No, there's nothing it seems. I guess we could support cookies in :parameters 🤔