hello,who can help me? I use
[metosin/reitit "0.5.12"].
My edn result is {:Amount 957840012233445.57M}, a bigdec format.
But when I use reitit to get a handler body. It will become {"Amount": 95784001223344.56}, resulting in some loss of precision. What should I do to keep data correct?
Hi, the answer depends whether you’re using spec, plumatic schema or malli for coercion. You can find relevant docs here https://cljdoc.org/d/metosin/reitit/0.7.1/doc/coercion
An old trick is to serialize large numbers to strings which might be “good enough” for some cases.
Hi all. What right way to make reitit-compatible interceptor from pedestal-interceptor? In my example i want to add io.pedestal.http.cors/allow-origin interceptor to path in reitit router. But allow-origin not implement IntoInterceptor protocol, so i got error.
I make it like this, but it doesn't feel right
(defn convert-pedestal-to-reitit-interceptor
[pedestal-interceptor]
{:name (:name pedestal-interceptor)
:enter (:enter pedestal-interceptor)
:leave (:leave pedestal-interceptor)
:error (:error pedestal-interceptor)})
Also interesting why extend-protocol reitit.interceptor/IntoInterceptor not support for io.pedestal.interceptor/Interceptor