-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing Support for suffixes eg. file extensions #17
Comments
I would be open to adding this feature but it's not really a high priority for me. It might be easier to put some time into writing a param parser at the application level. As a side note, this is the main benefit of the |
Now that 0.8 is released with the new syntax, I'll try to implement this. The tricky part is that we have to repeatedly attempt to match the suffix in the case that we don't get a full match earlier in the path, but the suffix exists elsewhere. This also means suffixes might not be as performant as a regular static segment, but hopefully this can be added without affect performance for existing routes. |
`axum` has some assumptions about the way paths are structured which may be potentially changed in a minor release. For example, there are plans to support [suffixes in matched segments](ibraheemdev/matchit#17) among other features which would allow routes such as `/{file}.jpg` which `axum` currently does not expect.
`axum` has some assumptions about the way paths are structured which may be potentially changed in a minor release. For example, there are plans to support [suffixes in matched segments](ibraheemdev/matchit#17) among other features which would allow routes such as `/{file}.jpg` which `axum` currently does not expect.
`axum` has some assumptions about the way paths are structured which may be potentially changed in a minor release. For example, there are plans to support [suffixes in matched segments](ibraheemdev/matchit#17) among other features which would allow routes such as `/{file}.jpg` which `axum` currently does not expect.
`axum` has some assumptions about the way paths are structured which may be potentially changed in a minor release. For example, there are plans to support [suffixes in matched segments](ibraheemdev/matchit#17) among other features which would allow routes such as `/{file}.jpg` which `axum` currently does not expect.
Hi it would be really useful for my use case to support suffixes.
e.g. routes like "/users/:id.png"
or even "/users/:id.:ext"
... or even "/users/*.png"
Although it is possible to do at the application level it quickly gets very complicated when multiple extensions are present, and it looks like it might be easier to implement it in Matchit.
According to what I understand from the docs the parameter extends up to the next slash, and so currently is not possible.
How easy would it be to change parameter names to not allow '.' and add something like ParamWithSuffix(String) to the enum NodeType.
I optimistically forked the repo and was planning to implement it but then I realized that I dont understand the code well enough... My fork just has the test case (that currently fails) See below:
To consider: how would multiple '.' be handled e.g. schema.foo.yaml
The text was updated successfully, but these errors were encountered: