The spring-data-rest documentation says:
If two entities are related to one another through a database-defined relationship, then that relationship will appear in the JSON as a link.
Is there a way to prevent a particular relationship from appearing as a link in the JSON, perhaps by extending RepositoryRestMvcConfiguration? I'd like for certain relationship's data to be embedded in the JSON rather than linked.
For example, currently owner is a link, but I'd rather it appeared as:
Adding @RestResource(exported = false) to the OwnerRepository would result in the JSON output I'm looking for but I'd like to still be able to query Owners directly.
Quote:
If two entities are related to one another through a database-defined relationship, then that relationship will appear in the JSON as a link.
For example, currently owner is a link, but I'd rather it appeared as:
Code:
"content" : [ {
"timestamp" : 1365191855896,
"id" : "17109",
"name" : "Fido",
"owner" : {
"id" : 2,
"name" : "John Smith"
}
}]