Fork me on GitHub
#reitit
<
2024-03-30
>
dominicm21:03:01

For query parameters is there a flag when integrating with malli coercion to make all keys optional?

dominicm10:04:27

That's a shame, seems like an important thing if you want additionally passed query parameters to be ignored. As they so often are by, e.g. social media.

ikitommi10:04:51

you can merge [:request :query-params] with [:parameters :query] to get the full set?

ikitommi10:04:25

but the reitit + malli integration should be redone, it’s complex but still not powerful enough to do what is needed

dominicm14:04:17

I need to confirm, but I think I'm getting the requests rejected when there's extra query parameters

dominicm14:04:31

I'll check now

dominicm14:04:07

{"value":{},"type":"reitit.coercion/request-coercion","coercion":"malli","in":["request","query-params"],"humanized":{"range":["missing required key"],"sort":["missing required key"],"filter":["missing required key"]}} This is the problem, the key isn't really required and I want it automatically non-required.

dominicm14:04:58

ah, I'm making that up that extra parameters cause a problem. So the only problem is that my explicitly requested query params aren't optional. Which requires me to use the "full" syntax rather than lite, which is a shame but hey ho 🙂