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

Route a method whose name is a reserved word. #11890

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amvanbaren
Copy link

Pull Request Checklist

Helpful things

Fixes

Fixes #11439

Purpose

What does this PR do?

  • It escapes method names that are a reserved word with backticks in files generated from the routes file.
  • It parses routes with backticks around the method name.

Background Context

Why did you take this approach?

@mkurz commented #11439 (comment) that we might be able to escape all the method we generate with backticks. While I was working on the issue I discovered there already is a safeKeyword method. I added a safeMethod method that is almost identical in functionality.

@proudust created a project that reproduces the issue. A couple of routes in the project have backticks around the method name. That's why I added functionality to the RoutesFileParser to parse routes with backticks around the method name.
I don't know if this is desirable. By allowing backticks around the method name a route like GET /space controllers.FooController.` `() should also be valid. @mkurz What do you think?

References

Are there any relevant issues / PRs / mailing lists discussions?

@mkurz
Copy link
Member

mkurz commented Aug 20, 2023

@amvanbaren Can you please resolve the conflicts by rebasing on current main branch? Thanks!

@mkurz mkurz added this to the 2.9.1 milestone Aug 21, 2023
@mkurz
Copy link
Member

mkurz commented Aug 21, 2023

Tagging this for 2.9.1

@amvanbaren
Copy link
Author

@mkurz I've rebased on the current main branch.

@mkurz
Copy link
Member

mkurz commented Mar 14, 2024

@Mergifyio rebase

Copy link
Contributor

mergify bot commented Mar 14, 2024

rebase

✅ Branch has been successfully rebased

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

Successfully merging this pull request may close these issues.

Routes cannot route a method whose name is a reserved word.
2 participants