spring-projects/spring-hateoas — pull request #236 by elnur (2014-08-24 01:35:47+00:00)
Title: Always serialize _embedded

An API should be consistent. If when we have elements in a collection, we get a response like

```json
{
"_embedded": {
"users": [
{
"username": "bob"
},
{
"username": "joe"
}
]
}
}
```

and then when there are no users found we get a response like

```json
{
}
```

it is not consistent and forces our clients to handle the special case of not having `_embedded.users` in the response.

Instead, what our clients reasonably expect is a response like

```json
{
"_embedded": {
"users": [
]
}
}
```