Is it possible in spring data rest to embed the data for relationships of the primary resource in the HAL response?
The reasoning is that in some cases the client knows she will need the Child
resource and the School
and Pets
relationships at once.
Using links this information can be requested in n requests, but ideally it would be possible to do in 1.
Note: n-levels deep would be great (JSON-API supports this) but for now even 1 level deep would be sufficient.
This is obviously possible according the HAL spec, and even possible using plain spring-hateoas (see this example).
- Is this possible in any fashion with spring-data-rest?
- Is it possible without a lot of boiler plate code and essentially rewriting bits of SDR?
If so, how is done? Examples would be most welcome.
Note that ALL the resources in question should be top-level resources, so no using @RestResource(exported = false)
and getting them inlined as advocated by Oliver here.