crnk-project / crnk-framework

JSON API library for Java
Apache License 2.0
287 stars 156 forks source link

Use hyphens instead of camel case for resources representation #255

Open ia97lies opened 6 years ago

ia97lies commented 6 years ago

Camel case notation in urls are a bit strange, better would be to have hyphens notation instead. Currently you have to do it with annotation like @JpaResource(type="foo-bar") for your FooBarEntity to avoid having fooBar in the path but have foo-bar instead.

Would be cool IMO if the path notation style is configurable. Maybe also underscores as an option.

remmeier commented 6 years ago

A general naming strategy would be great I guess that is able to derive the json from the java names. For field names it is already possible with a custom ResourceFieldInformationProvider. But resource naming is still hard-wired into DefaultResourceInformationProvider. Maybe the naming strategy could take care of both thins and a hypen one is provided out-of-the-box in crnk-core.