I'm building a Spring REST application using Spring HATEOAS (0.16.0.RELEASE) and I'd like the JSON links output to look like:
_links: {
self: {
href: "https://<ip>/api/policies/321"
}
}
while it renders like:
"links":
[{
"rel":"self",
"href":"http://<ip>/api/policies/321"
}]
I'm using HATEOAS Resource
and ResourceAssembler
.
Why do I get this format instead of the other? How can I change it?
_links
and an object where the key is the link relation and the value can be an array of links or a single link. By collection+json you uselinks
which is an array of links. – Henbit