Fork me on GitHub
Janne Sauvala21:04:06

Hi 👋:skin-tone-2: can reitit validate parameter values specified by spec or malli? Is it possible to tell that the parameter should be int and also between values x and y? Or is this something that the handler needs to take care of? I know it can coerce the parameter to the type int but how about the later part 🙂


hi. sure you can, for example with malli you can say [:int {:min 1, :max 100}].


or [:and :int [:fn (fn [x] (>= 1 x 100)]]


with spec i recall it’s: (s/int-in 1 100)

Janne Sauvala14:04:51

That worked beautifully! This reduces the amount of boilerplate code I need to write 🙂

Janne Sauvala14:04:38

My mistake was that I tried to use the validation like I saw it in the examples in Malli repo: {:path [:map [:quiz [:and int? [:> 6]]] [:option int?]]}. I think it worked somehow but the output error wasn’t so beautiful:

"message": "unknown error",
      "schema": "[:> 6]",
      "type": null,
      "value": 1,
      "in": [


I also trying to validate form-params, but it seems I cannot make it work. May you have any examples?


Have you looked at the tests @U5JD0DZPA?


wow, thanks again ikitommi! No I didn't check them. I will now 🙂


Is there a way to make reitit.frontend.history not URL-encode a specific path parameter? I have a route like /foo/*bar, and I want to be able to use it to link to URLs like /foo/bar/baz.