From f793a224c7c11f6370cc33ca0d6d331f66ded0f1 Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Wed, 21 Mar 2018 07:56:29 +0200 Subject: [PATCH] Update docs --- doc/basics/name_based_routing.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/basics/name_based_routing.md b/doc/basics/name_based_routing.md index 69bbf6af..f428e6a4 100644 --- a/doc/basics/name_based_routing.md +++ b/doc/basics/name_based_routing.md @@ -64,6 +64,17 @@ With provided path-parameters: ; :path-params {:id "1"}} ``` +Path-parameters are automatically coerced into strings, with the help of (currently internal) Protocol `reitit.impl/IntoString`. It supports numbers, booleans, keywords and objects: + +```clj +(r/match-by-name router ::user {:id 1}) +; #Match{:template "/api/user/:id" +; :data {:name :user/user} +; :path "/api/user/1" +; :result nil +; :path-params {:id "1"}} +``` + There is also a exception throwing version: ```clj