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.