As the title says, I have a resource object Product extending ResourceSupport. However, the responses I receive have the property \"_links\" instea
I have notice the problem appears at least when you trying to return an object extends ResourseSupport vs object containing object extends ResourseSupport. You may return even List or Array of object(s) extends ResourseSupport and have the same effect. See the example :
@RequestMapping(method = GET, value = "/read")
public NfcCommand statusPayOrder() {
return generateNfcCommand();
}
have response:
{
"field": "123",
"_links": {
"self": {
"href": "http://bla_bla_bla_url"
}
}
}
When try to wrap as List:
@RequestMapping(method = GET, value = "/read")
public List statusPayOrder() {
return Arrays.asList(generateNfcCommand());
}
getting:
[
{
"field": 123
"links": [
{
"rel": "self",
"href": "http://bla_bla_bla_url"
}
]
}
]
Changing structure of an answer is not the right decision, but we can try to think further this way.