Heads up: I think 0.9.0 breaks for many users. Coercion will throw a null pointer exception if it encounters a response code that's not listed under :responses. That's not intentional. I hope verify this and to have a fix out real soon.
EDIT: version number
is there an issue for this? (for linkback purposes)
not yet...
issue confirmed: https://github.com/metosin/reitit/issues/742
luckily the fix is a oneliner https://github.com/metosin/reitit/pull/743
Release 0.9.1 is out
Hey! We're using reitit and muuntaja in one project. We're trying to have a route return an edn data structure. We manage to get reitit (with the help of muuntaja middlewares) to return an edn string from our route. However, we can't seem to get muuntaja to serialize custom tagged literals like #object[java.time.OffsetDateTime 0x33ef7a96 \"2025-05-21T12:48:40.944825Z\"] , so currently the returned edn string contains these tagged literal.
Example of the returned edn string "{:timestamp #object[java.time.OffsetDateTime 0x33ef7a96 \"2025-01-01T12:00:00.000000Z\"]}
Is there anyway to get muuntaja or some reitit middleware to serialize tagged literals when encoding edn to strings?
edn serialization goes through clojure.edn the encoder doesn't take options on how to encode custom classes, instead you just need to extend clojure.core/print-method for those classes
Similar to this, but for Java.time classes: https://github.com/clj-time/clj-time/blob/b1558aa5b2fc6d052594a3aedca6f23e143a4e5b/src/clj_time/coerce.clj#L122-L125
Thanks! This was precisely what we were looking for!