Endpoint naming - kebab-case

Issue #50 closed
Stig Nørgaard Færch created an issue

I did some research on best practices on endpoint naming.

One thing to avoid is camelCasing the endpoints, as they become less readable. Instead kebab-case is better.

It would be really nice if the endpoint class names and method names could be translated to kebab-case. Of course it should be optional through an extension setting.

Comments (3)

  1. Stig Nørgaard Færch reporter

    I think the best would be if both would work at the same time. For example:

    /api/facebookSharing/connectionStatus

    /api/facebook-sharing/connection-status

    The extension setting, should then only decide which one is prefered to be shown in the interface.

  2. Stig Nørgaard Færch reporter

    I found it’s possible to decide a custom route instead of using the routing by method-name, by adding this annotation:

        * @Api\Route("GET /facebook-sharing/connection-status")
    

    That’s is great!

    But I would still prefer that kebab-case would work by default by method-name.

  3. Log in to comment