You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow a way to register routes (and route fragments) that include a literal :
Motivation
REST (GCP) Api (Azure) Guidelines† (OpenAPI) suggest mechanisms to define custom verbs using POST /collection/{id}:verb. In axum, this is ambiguous as /collection/12:archive for the route /collection/:id:verb matches get(Path(id): Path<String>) as "12:archive". That is, the :verb gets ignored, and the entire fragment gets assigned to the first parameter match.
† Ok it's not technically in there, but it's not forbidden, as far as I can tell
Proposal
Switch (or provide the option) to use {curly-delimited} path templates. This conveniently aligns with the OpenAPI path templating spec.
Alternatives
Recognize Additional :foo after the first :path in a route fragment as literal. That is, for a route section between two "/", only the first :portion is recognized.
The text was updated successfully, but these errors were encountered:
Feature Request
Allow a way to register routes (and route fragments) that include a literal
:
Motivation
REST (GCP) Api (Azure) Guidelines† (OpenAPI) suggest mechanisms to define custom verbs using
POST /collection/{id}:verb
. In axum, this is ambiguous as/collection/12:archive
for the route/collection/:id:verb
matchesget(Path(id): Path<String>)
as"12:archive"
. That is, the:verb
gets ignored, and the entire fragment gets assigned to the first parameter match.† Ok it's not technically in there, but it's not forbidden, as far as I can tell
Proposal
Switch (or provide the option) to use
{curly-delimited}
path templates. This conveniently aligns with the OpenAPI path templating spec.Alternatives
Recognize Additional :foo after the first :path in a route fragment as literal. That is, for a route section between two "/", only the first :portion is recognized.
The text was updated successfully, but these errors were encountered: