-
SummaryI'm experimenting with an authorization framework, and I'd like to be able to extract facts about a general request in order to apply policy to it. Being able to consider the path params of a request would be very helpful. I see #154, where the UrlParams extractor was removed, and that the UrlParams extension has been made Is there a different approach for extracting some unknown number of path parameters, perhaps equivalent to how the axum version0.7.5 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Aha - just found |
Beta Was this translation helpful? Give feedback.
-
Yes, you can extract all path parameters using #[derive(Deserialize)]
struct Parameters {
foo_id: Option<Uuid>,
bar_id: Option<Uuid>,
name: Option<String>,
}
// you can use `Path(params): Path<Parameters>` and if the route has a `foo_id` param,
// `params.foo_id` will have the deserialized parameter value |
Beta Was this translation helpful? Give feedback.
Aha - just found
extract::RawPathParams
that seems to do what I need.