Closed hgzimmerman closed 8 months ago
I think escaping with \
makes sense. /prefix:parameter
is accepted by matchit, which makes the second option more difficult.
Just opened this (and linked) from Axum. I would also like to propose using /{id}
for path pattern matching, to align with the OpenAPI spec.
With the release of 0.8, the route parameter syntax has changed to use {x}
or {*x}
. You can escape literal {
and }
characters with {{
and }}
in static routes.
I'm using this library by proxy of Axum, and ran into an issue in that the router would not accept path segments that contained multiple
:
characters, greeting me with the error:Invalid route "/Schemas/urn:ietf:params:scim:schemas:core:2.0:User": only one parameter is allowed per path segment
, corresponding to theTooManyParams
error variant defined in this crate.Could either the syntax be altered to support escaping the
:
and*
characters with a prefix like\
, or have the insert method treat the whole path section as a literal if it doesn't start with a:
or*
, or add an.insert_components()
function that takes a slice ofenum Component<'a>{Literal(&'a str), Param, Wildcard, Separator}
and uses that to determine the matching criteria?