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

Reserve characters for path parameters #308

Open
empijei opened this issue May 28, 2021 · 1 comment
Open

Reserve characters for path parameters #308

empijei opened this issue May 28, 2021 · 1 comment

Comments

@empijei
Copy link
Contributor

empijei commented May 28, 2021

We should reserve some characters to support path parameters in the future.

I propose to reserve $ as a trigger for path parameters.

Examples:

  • /users/$id:int/page: this parses the ID parameter as int
  • /users/bar:foo: this does nothing because the path parameter doesn't start with a $
  • /users/$id/page: invalid, missing type information.

If this syntax is okay we can just forbid path segments to start with $ for now and revisit this feature in a future version.

If we do this inside the framework implementation would be quite simple and we can ensure a strict and well defined type checking. To access those path parameters we could just put them as a secure form inside the incoming request object.

@kele
Copy link
Collaborator

kele commented Jun 2, 2021

I'd rather not do that before we have a design for path parameters handling. Most importantly, I'm not sure this should belong to the core framework, or to an interceptor.

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

No branches or pull requests

2 participants