Details
-
Type:
Improvement
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.2.1 (Evans SR1)
-
Fix Version/s: 2.4 M1 (Gosling), 2.3.1 (Fowler SR1), 2.2.3 (Evans SR3)
-
Component/s: None
-
Labels:None
-
Sprint:56 - Fowler RC1, 56 - Fowler GA, 57 - Fowler Aftermath, 58 - Gosling M1, 59 - Evans / Fowler SR, Gosling RC1
Description
Let's consider authors and books relations from spring-data-rest-webmvc module tests.
Here is an example of the authors rel output:
{ "_embedded": { "authors": [ { "name": "Ollie", "_embedded": { "books": [ { "title": "Spring Data" }, { "title": "Spring Data (Second Edition)" } ] }, "_links": { "self": { "href": "http://localhost/authors/1" } } } ] } }
Since we inlined books into authors resource we do not show the books association link in the links section for a given author. (according to DATAREST-317)
Issue: It brakes further navigation (discoverability). It's not possible to navigate to the associated book resource from the authors collection.
Solution: to show links for inlined resources
Here is an example:
{ "_embedded": { "authors": [ { "name": "Ollie", "_embedded": { "books": [ { "title": "Spring Data (Second Edition)", "_links": { "self": { "href": "http://localhost/books/2-2{?projection}", "templated": true }, "authors": { "href": "http://localhost/books/2-2/authors" } } } ] }, "_links": { "self": { "href": "http://localhost/authors/1" } } } ] } }
This is actually how HAL suggests it to be http://stateless.co/hal_specification.html
A pull request is underway.
Attachments
Issue Links
- duplicates
-
DATAREST-302 Handle resource links of resources inlined using @Projection
-
- Closed
-