How should a response for a set of links be in order to comply with REST principles (HATEOAS) and HAL (specification, Internet-draft)?
Is it alright to have no attributes on the first level of the JSON body and have just the _links section with the self link and the _embedded section with the links found for that particular request?
UPDATE: Example
Request to: http://localhost:5555/myservice/titles/meow/kittens
Returns:
{
"_links": {
"next": {
"href": "/myservice/titles/meow/kittens?page=2"
},
"self": {
"href": "/myservice/titles/meow/kittens"
},
"anchestor": {
"href": "/myservice/titles/meow"
}
},
"_embedded": {
"linksINeed": [
{
"title": "kitten play",
"_links": {
"self": {
"href": "/myservice/titles/kitten-play"
}
}
},
...
{
"title": "kitten eat",
"_links": {
"self": {
"href": "/myservice/titles/kitten-eat"
}
}
}
]
}
}
Is this valid RESTful HAL JSON ? Thanks