0

I'm working on a website route path settings. We have a path, say, /folders/ to list all folders, and there're /folders/:name paths for folders.

When it comes to the path for folder creation, my college wants to use /folders/:name/add for route matching with the Add Folder button navigates to /folders/self/add. I have to agree that this /folders/:name/add route matching is better than the explicit /folder/self/add route matching in some way that in the future, if somebody wants to add a /folders/:name/add route matching for another purpose, he/she would see there are duplicates and hence the conflict is avoided.

With an unused parameter for route-matching makes me nervous. Besides, the user can manually enter any arbitrary /folder/whatsoever/add that will also navigate to the folder creation page.

Therefore I suggested /folders/@/add, in which @ is an illegal character for a folder name. At the same time, this @ can stand for actions.

But my college said he cannot agree with the /folders/@/add route matching for that the character @ is rare in HTTP address path.

It's really hard to google the answer for this is it common or not for an HTTP address path having the @ character in it question.

In your experiences, what's the answer?

Thanks.

KingMario
  • 161
  • 2
  • 10
  • [Can I use an at symbol (@) inside URLs?](https://stackoverflow.com/q/19509028/1591669) --- Google Maps seem to use it, for example: [@ sign as url parameter separator?](https://stackoverflow.com/q/22221252/1591669) – unor Jan 17 '19 at 03:20
  • @unor Thx for the link. I finally convinced my colleague to accept my suggestion. And I think for Google Maps, @ means `at` as in this [answer](https://stackoverflow.com/a/22249968/2279231). – KingMario Jan 24 '19 at 07:20

0 Answers0