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

Support Naming Strategy JpaRepository [DATAREST-1402] #1761

Closed
spring-projects-issues opened this issue Jun 24, 2019 · 3 comments
Closed

Support Naming Strategy JpaRepository [DATAREST-1402] #1761

spring-projects-issues opened this issue Jun 24, 2019 · 3 comments
Assignees
Labels

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jun 24, 2019

Victor Augusto Farias Dinis opened DATAREST-1402 and commented

Hi there,

I was researching about conventions regarding RESTful services, and I found this article https://github.com/NationalBankBelgium/REST-API-Design-Guide/wiki/REST-Resources-Naming

As it mentions, one convention is about using kebab-case on resources

I'm using Spring Data REST and I have an Entity named OccupationArea, and with JpaRepository, Spring gives me this endpoint:
http://localhost:8080/occupationAreas

I know that I can override the resource name like the code below, but I would like to intercept the strategy for naming, to make all entities with more than one word, to spring generate its resource with kebab-case, instead of camelCase.

 

@RepositoryRestResource(collectionResourceRel = "occupation-areas", path = "occupation-areas")
public interface OccupationAreaRepository extends JpaRepository<OccupationArea, Long> { }

 

I have tried to configure spring.jackson.property-naming-strategy, but it only changes the properties names, not the resources.

 

Is it possible to do that? I've searched and couldn't find anything about this.

If it is not possible, can it become a new feature on the framework?

Thanks in advance


No further details from DATAREST-1402

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 26, 2019

Oliver Drotbohm commented

There's only very little emphasis on the paths that are exposed by Spring Data REST as the very core aspect underlying it is the use of hypermedia, which means, the structure of the target URI doesn't matter at all. For link relation customizations, there is the RelProvider (or LinkRelationProvider API as of 1.0) in Spring HATEOAS. See the reference documentation for details

@spring-projects-issues spring-projects-issues added status: waiting-for-feedback in: repository type: enhancement labels Dec 31, 2020
@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 7, 2021

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder label Jan 7, 2021
@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 14, 2021

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback status: feedback-reminder labels Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants