Fork me on GitHub
#reitit
<
2018-09-19
>
seantempesta09:09:36

I bit confused by something: how can an endpoint using spec coercion successfully run the coercion (I see it in debug breakpoints and debug messages), but the actual data delivered to the endpoint handler isn’t coerced? I tried manually putting :coercion reitit.coercion.spec/coercion in the endpoint definition, but the :body-params is still the uncoerced data.

ikitommi09:09:04

@seantempesta the coerced parameters are under :parameters in the request. The raw params are left untouched, e.g. :body-params.

seantempesta09:09:30

ahhhhhhh. well shit, now I feel stupid. thanks @ikitommi!

ikitommi09:09:45

np, happy to help.

insano1013:09:03

Afternoon. Is there some middleware or something that can turn query parameter keys into keywords like how body parameters are?

grierson13:09:57

If you wrap-param and wrap-keyword-param then your body parameters should be in :params as keywords.

insano1014:09:48

Thanks, but I just found the keywordized versions inside :parameters/:query. Was previously looking at :query-params.