Skip to content
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

Consider dropping : from path pattern #5710

Open
ikhoon opened this issue May 31, 2024 · 0 comments
Open

Consider dropping : from path pattern #5710

ikhoon opened this issue May 31, 2024 · 0 comments

Comments

@ikhoon
Copy link
Contributor

ikhoon commented May 31, 2024

: is useful to bind a path variable. However, : is a variable character for a path.
If a path variable :foo is mixed with a literal :, it is ambiguous and difficult to know the exact scope of the variable, e.g. /api/v1/:project:get.

Currently, project:get is regarded as a path variable. It makes no sense because I believe most people intend to use project as the path variable and :get is an exact path match.

I don't see that it is inconvenient to only use {project} in a path pattern. Excluding : from path variables and using it only as literals would be a way to eliminate ambiguity and simplify our logic.

Instead, : could be used as a special character within {} to indicate the type of the parameter.

// TODO: Implement param options expressed like `{bar:type=int,range=[0,10]}`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant