Closed Regaez closed 4 years ago
The children property should be moved out of the PageResource attributes and added to the links hypermedia.
children
attributes
links
For example:
"links": { "self": "http://localhost:8080/parent-page", "children": [ "http://localhost:8080/parent-page/child-1", "http://localhost:8080/parent-page/child-2" ], "related": { "self": "http://localhost:8080/api/pages/parent-page", "children": [ "http://localhost:8080/api/pages/parent-page/child-1", "http://localhost:8080/api/pages/parent-page/child-2" ], "resource": "http://localhost:8080/api/pages/" } }
Similarly, a child page should have a parent link:
child
parent
"links": { "self": "http://localhost:8080/parent-page/child-1", "parent": "http://localhost:8080/parent-page", "related": { "self": "http://localhost:8080/api/pages/parent-page/child-1", "parent": "http://localhost:8080/api/pages/parent-page", "resource": "http://localhost:8080/api/pages/" } }
Similarly, a child page should have a siblings field for pages at the same level:
siblings
"links": { "self": "http://localhost:8080/parent-page/child-1", "parent": "http://localhost:8080/parent-page", "siblings": [ "http://localhost:8080/parent-page/child-2" ], "related": { "self": "http://localhost:8080/api/pages/parent-page/child-1", "parent": "http://localhost:8080/api/pages/parent-page", "siblings": [ "http://localhost:8080/api/pages/parent-page/child-2" ], "resource": "http://localhost:8080/api/pages/" } }
Perhaps related should be renamed to api (since it's currently only API links)? 🤔
related
api
The
children
property should be moved out of the PageResourceattributes
and added to thelinks
hypermedia.For example:
Similarly, a
child
page should have aparent
link:Similarly, a
child
page should have asiblings
field for pages at the same level: