I am currently developing using Spring Data REST and things are going swimmingly apart from one thing. The plural nouns don't match the language of my API.
I have an Entity called Test that has a bidirectional @OneToMany relationship (with Resultaat) exposed via Data REST. In my language the plural of test is testen, and of resultaat is resultaten. The "TestRepository" is annotated with:
And when I retrieve "testen" everything works fine. Also the relationship uses the correct plural (based on the name of the property that contains the "resultaten"). So the URI /testen/{id}/resultaten/{id} works. However the self links of Resultaat show "resultaats" in the URI which is the wrong plural.
If I try to define a RepositoryRestResource for Resultaat, the resultaten are mapped correctly, but the api changes the path of "testen" back to "tests" which is a bug in my opinion.
I think it would be handy to solve this issue via an annotation on the entities, that can override the default pluralization.
I can provide an example project of this later in this week if required.
I have also noticed that the TestRepository sometimes gets mapped to /tests and sometimes to /testen. This sort of non-deterministic behavior is quite strange
Ewout Van Gossum opened DATAREST-1131 and commented
I am currently developing using Spring Data REST and things are going swimmingly apart from one thing. The plural nouns don't match the language of my API.
I have an Entity called Test that has a bidirectional
@OneToMany
relationship (with Resultaat) exposed via Data REST. In my language the plural of test is testen, and of resultaat is resultaten. The "TestRepository" is annotated with:And when I retrieve "testen" everything works fine. Also the relationship uses the correct plural (based on the name of the property that contains the "resultaten"). So the URI /testen/{id}/resultaten/{id} works. However the self links of Resultaat show "resultaats" in the URI which is the wrong plural.
If I try to define a RepositoryRestResource for Resultaat, the resultaten are mapped correctly, but the api changes the path of "testen" back to "tests" which is a bug in my opinion.
I think it would be handy to solve this issue via an annotation on the entities, that can override the default pluralization.
I can provide an example project of this later in this week if required.
No further details from DATAREST-1131