@@ -19,15 +19,15 @@ use serde::Serialize;
1919/// RouterExt, // for `Router::typed_*`
2020/// };
2121///
22- /// // A type safe route with `/users/:id ` as its associated path.
22+ /// // A type safe route with `/users/{id} ` as its associated path.
2323/// #[derive(TypedPath, Deserialize)]
24- /// #[typed_path("/users/:id ")]
24+ /// #[typed_path("/users/{id} ")]
2525/// struct UsersMember {
2626/// id: u32,
2727/// }
2828///
2929/// // A regular handler function that takes `UsersMember` as the first argument
30- /// // and thus creates a typed connection between this handler and the `/users/:id ` path.
30+ /// // and thus creates a typed connection between this handler and the `/users/{id} ` path.
3131/// //
3232/// // The `TypedPath` must be the first argument to the function.
3333/// async fn users_show(
@@ -39,7 +39,7 @@ use serde::Serialize;
3939/// let app = Router::new()
4040/// // Add our typed route to the router.
4141/// //
42- /// // The path will be inferred to `/users/:id ` since `users_show`'s
42+ /// // The path will be inferred to `/users/{id} ` since `users_show`'s
4343/// // first argument is `UsersMember` which implements `TypedPath`
4444/// .typed_get(users_show)
4545/// .typed_post(users_create)
@@ -75,7 +75,7 @@ use serde::Serialize;
7575/// use axum_extra::routing::TypedPath;
7676///
7777/// #[derive(TypedPath, Deserialize)]
78- /// #[typed_path("/users/:id ")]
78+ /// #[typed_path("/users/{id} ")]
7979/// struct UsersMember {
8080/// id: u32,
8181/// }
@@ -100,7 +100,7 @@ use serde::Serialize;
100100/// use axum_extra::routing::TypedPath;
101101///
102102/// #[derive(TypedPath, Deserialize)]
103- /// #[typed_path("/users/:id /teams/: team_id")]
103+ /// #[typed_path("/users/{id} /teams/{ team_id} ")]
104104/// struct UsersMember {
105105/// id: u32,
106106/// }
@@ -117,7 +117,7 @@ use serde::Serialize;
117117/// struct UsersCollection;
118118///
119119/// #[derive(TypedPath, Deserialize)]
120- /// #[typed_path("/users/:id ")]
120+ /// #[typed_path("/users/{id} ")]
121121/// struct UsersMember(u32);
122122/// ```
123123///
@@ -130,7 +130,7 @@ use serde::Serialize;
130130/// use axum_extra::routing::TypedPath;
131131///
132132/// #[derive(TypedPath, Deserialize)]
133- /// #[typed_path("/users/:id ")]
133+ /// #[typed_path("/users/{id} ")]
134134/// struct UsersMember {
135135/// id: String,
136136/// }
@@ -158,7 +158,7 @@ use serde::Serialize;
158158/// };
159159///
160160/// #[derive(TypedPath, Deserialize)]
161- /// #[typed_path("/users/:id ", rejection(UsersMemberRejection))]
161+ /// #[typed_path("/users/{id} ", rejection(UsersMemberRejection))]
162162/// struct UsersMember {
163163/// id: String,
164164/// }
@@ -215,7 +215,7 @@ use serde::Serialize;
215215/// [`Deserialize`]: serde::Deserialize
216216/// [`PathRejection`]: axum::extract::rejection::PathRejection
217217pub trait TypedPath : std:: fmt:: Display {
218- /// The path with optional captures such as `/users/:id `.
218+ /// The path with optional captures such as `/users/{id} `.
219219 const PATH : & ' static str ;
220220
221221 /// Convert the path into a `Uri`.
@@ -398,7 +398,7 @@ mod tests {
398398 use serde:: Deserialize ;
399399
400400 #[ derive( TypedPath , Deserialize ) ]
401- #[ typed_path( "/users/:id " ) ]
401+ #[ typed_path( "/users/{id} " ) ]
402402 struct UsersShow {
403403 id : i32 ,
404404 }
0 commit comments