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

Ressource URLs naming strategy #534

Closed
polc opened this issue May 11, 2016 · 4 comments
Closed

Ressource URLs naming strategy #534

polc opened this issue May 11, 2016 · 4 comments

Comments

@polc
Copy link
Contributor

polc commented May 11, 2016

Hello,

I wonder why in multi words entities names (like PasswordReset) the URL generated have "_" seperator and not "-" (like /password_reset, I want /password-reset), and if I can change the naming strategy somewhere.

ps: thanks for the great work!

@polc polc changed the title Ressource URLs Ressource URLs naming strategy May 11, 2016
@teohhanhui
Copy link
Contributor

It's not currently supported for default operations (their routes are automatically added). If you insist, you can still manually declare all the operations, but it's a lot of work for not much return. I love dashes too, but I think there's no need to obsess over pretty-looking URLs for an API.

Alternatively: figure out a way and send a PR. I'm sure we'll all be happy. (But no BC breaks if you're doing it for 1.x)

@polc
Copy link
Contributor Author

polc commented May 11, 2016

Is changing naming strategy in 2.x without touching 1.x version an acceptable solution ?

Or It would be too bad for people migrating from v1 to v2 ?

Anyway, I don't think making naming strategy configurable is a good thing.

@theofidry
Copy link
Contributor

See #165.

That being said it would be nice to have it configurable. It's not a problem API, it's more a matter to be able to choose a convention and stick to it. You have the same debate over and over for databases; in the end the choice that has been made in most of ORM is to let the user choose the convention he wants to use.

@dunglas
Copy link
Member

dunglas commented May 11, 2016

BC breaks are still OK for 2.0 (until we release it). It's now or never :)

Having a naming strategy would be nice (and I'm pretty sure it can be done easily) by injecting a strategy in this class: https://github.com/api-platform/core/blob/master/src/Bridge/Symfony/Routing/ApiLoader.php#L58

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

4 participants