Fork me on GitHub
#reitit
<
2021-10-30
>
Ben Sless18:10:33

@U061V0GG2 my main hangup with this implementation is I do not understand why I need to plug the same transformer to :string as well

juhoteperi18:10:41

Why do you need the additional transformer in this example?

juhoteperi18:10:32

i.e. why do need to define :query transformer? Is there something using that?

juhoteperi18:10:00

by default query-params, form-params, header-params and path-params use string transformer: https://github.com/metosin/reitit/blob/master/modules/reitit-core/src/reitit/coercion.cljc#L38

Ben Sless18:10:08

hold over from my implementation where the query params map had its own transformer, too

Kira McLean20:11:06

this is great, thanks for sharing. not sure if you saw the rest of the old thread but turns out I could make it work by adding a :decode/string fn

Ben Sless05:11:49

That's true. This assumption would not have held however if you need something which operates on top of string decoding. I had a use case where I converted milliseconds to seconds. The string decoder gave me back a number. My own decoder divided it by 1000