Fork me on GitHub

Yes, makes sense


I've included the coercion middleware at the top level of my routes, and the :coercion key there as well. I like that as it keeps everything in one place, at the start of the routing where it's clear. Thanks for your help!

👌 4

Hi, I'm still struggling with coercion. Without the coerce-request-middleware, everything works fine, but as soon as I add it in, the :body , :content-type and :content-length of my request become nil , and so the request fails to validate against my body spec because it's expecting a map. what have i done wrong that's stripped all the good stuff from my request?


for reference, here's my route:

["" {:get get-invitations
     :post {:parameters {:body :cue/new-invitation-request}
            :handler send-invitation}}]


my path params are being coerced correctly however, which is what got me into coercion to begin with


i'd rather not have to fight this. anybody know if there's a way to do path coercion without having to mess around with the request?


all i need is uuid parameters in my routes to be coerced from strings


@conan I would start from some of the example apps. They have everything setup correctly.


also, there is the request-diff helper commented out in the router options. Uncommenting that will print what each mw does to the request/response. There should be nothing resetting the :content-type.


ok thanks


i seem to find this much harder than most 😂


no opinions in a framework means a lot of options (and ways to go wrong). should be simpler, with opinions for mostly everything.

Janne Sauvala22:11:07

Sorry for off-topic but that list looks really interesting and I agree with most of them. Which HTTP-library would you choose if you had to replace Pohjavirta with something else?