spring-projects / spring-projects/spring-data-rest
Wrong rel rendered for entity property [DATAREST-177]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Petar Tahchiev opened DATAREST-177 and commented
Hi guys,
I have an attribute of type MediaFormat inside my Media entity. So the definition looks like this:
@Entity
public class Media {
.....
@ManyToOne
private MediaFormat mediaFormat;
}
and the MediaFormat repository is mapped as:
@RestResource(rel = "media_format", path = "media_format")
public interface MediaFormatRepository {
....
}
then spring-data-rest exports that as the following:
{
"rel" : "mediaFormat",
"href" : "http://localhost:8111/rest/media/140738176859576896/mediaFormat"
}
As you can see both the rel and the url contain the name of the attribute (mediaFormat), but not the repository mapping ("media_format"). So when I browsing the model I have no idea what is the type of the rel. Yes, I know it's obvious when it's named mediaModel, but with the same success I could have named it abc
Affects: 2.0 M1 (Codd)
1 votes, 2 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.