reitit

joshkh 2024-03-13T10:52:28.056799Z

hello! iโ€™m stuck with com.fasterxml.jackson.core/jackson-core 2.12.3 on Datomic Ions, where the latest metosin/jsonista fails to compile. whatโ€™s the latest version of metosin/reitit i can get away with? perhaps https://github.com/metosin/reitit/blob/0.5.18/project.clj?

2024-03-28T15:58:41.006209Z

We are using 0.6.0 (the latest non-alpha release) but with the caveat that you can't depend on the 'all bundled' reitit. Specifically, we found that it was reitit-swagger-ui that caused the clash with datomic ions. So instead of (which pulls in all modules):

[metosin/reitit "0.6.0"]
We list only the modules that we use:
metosin/reitit-core       {:mvn/version "0.6.0"}
metosin/reitit-ring       {:mvn/version "0.6.0"}
metosin/reitit-middleware {:mvn/version "0.6.0"}
metosin/reitit-malli      {:mvn/version "0.6.0"}
metosin/reitit-swagger    {:mvn/version "0.6.0"}
metosin/reitit-sieppari   {:mvn/version "0.6.0"}
metosin/reitit-dev        {:mvn/version "0.6.0"}
You might have to list some other modules, depending on if you use spec/schema/interceptors. Remember that you have to remove the route that serves the swagger-ui. This is only the static assets for the front-end that is used to browse the API documentation, it does not affect the generation of swagger.json file itself. We just host the swagger-ui somewhere else - it's just some HTML & JavaScript that you can get from the Swagger website (if you are using Swagger, that is).

joshkh 2024-03-28T16:03:31.649339Z

hi @andre.richards, really great of you to help. thank you. we eventually settled on the same solution: use the latest stable reitit release excluding swagger-ui, and host the static ui somewhere else. it would have been nice to package the json and the ui in one place, but oh well ๐Ÿ˜Ž

2024-03-28T16:04:54.513199Z

Yip. Sorry I only saw this now, could've saved you some time investigating the issue again... ๐Ÿ˜†

joshkh 2024-03-28T16:06:04.842749Z

thanks just the same. at least we had a learning opportunity!

vemv 2024-03-13T13:01:17.737379Z

In reitit, Is there a favorite way to set basic request info (url, method) that the Thread$UncaughtExceptionHandler will see? I could use thread-local storage, but it's often inadequate (e.g. what if I'm using an async server) There's also dynamic bindings (as implied by e,g, timbre/with-context ) but those can be easily lost

vemv 2024-03-13T13:03:37.038509Z

Sounds like something that reitit.ring.middleware.exception/create-exception-middleware can be tweaked to do ๐Ÿค” duckie