reitit 2024-11-26

Is there a way to replace a single decoder in the json-transformer of the malli coercer in reitit? I have an API that I'm converting from Liberator to reitit, and it used to support string values for decimal numbers, so I'd like to comp the -string->double and -number->double, but I'd rather not rewrite the whole malli.transform/json-transformer. It's probably something simple that I'm overlooking, but I can't see an easy way to push a new decoder in there.

you can set a custom decoder for that schema, using malli props

🙇 1

(m/decode
  [string? {:decode/string clojure.string/upper-case}]
  "kerran" mt/string-transformer)
; => "KERRAN"

happy to help!