I run an SDR application based on the Spring Boot Gradle Plugin. I recently upgraded from 2.1.9.RELEASE to 2.2.0.RELEASE. Without being 100% sure that this was the very reason, SDR now seems to expose an additional _embedded
field for every resource. The new field contains data of related entities.
As an example, this is a resource exposed with 2.1.9.RELEASE:
{
"uuid": "77315176-cb4f-4126-8e8b-9007457a7ce1",
"name": "root",
"_links": {
"self": {
"href": "localhost/users/1"
},
"user": {
"href": "localhost/users/1"
},
"group": {
"href": "localhost/users/1/group"
}
}
}
The same resource exposed with 2.2.0.RELEASE:
{
"uuid": "77315176-cb4f-4126-8e8b-9007457a7ce1",
"name": "root",
"_embedded": {
"group": {
"uuid": "be43382c-7b03-4d28-9597-7284986f700b",
"name": "admin"
}
},
"_links": {
"self": {
"href": "localhost/users/1"
},
"user": {
"href": "localhost/users/1"
},
"group": {
"href": "localhost/users/1/group"
}
}
}
Without a proof, I assume the following downsides:
- It increases the response size considerably. I can understand that there are use cases in which this additional data is desired, however, in such cases I prefer exposing it manually by crafting Projections as needed.
- In order to collect the additionally exposed data, additional database transactions are required, which negatively impacts performance.
- More public API is exposed by default, which one has to maintain. Again, I'd prefer to make use of Projections in order to minimize the response if possible.
This are my questions:
- Is it possible to restore the previous API format, e.g. customizing the new feature or by turning it off completely?
- I wonder what was the design desicion for this. Given the above-assumed downsides, which advantages come with the new feature?