Controller returns ResponseEntity
@GetMapping("/users/{id}")
public ResponseEntity<UserResource> getUserById{}
User resource is extended from RestResource
public class UserResource extends ResourceSupport {}
When I call the rest API, I get
{
"user": {
"id": 49,
"firstName": "Admin"
},
"links": [
{...}]
}
How do I get it without the top level wrapped? like this?
{
"id": 49,
"firstName": "Admin"
}
It's interesting because when I use Spring Data Rest, the data returned is actually the latter kind but SDR also uses Spring-HATEOAS.