As the title says, I have a resource object Product
extending ResourceSupport
. However, the responses I receive have the property \"_links\" instea
Spring Boot now (version=1.3.3.RELEASE) has a property that controls the output JSON format of the PagedResources
.
Just add the following config to your application.yml
file:
spring.hateoas.use-hal-as-default-json-media-type: false
if you need the output to be like (based on question):
{
"productId" : 1,
"name" : "2",
"links" : [
{
"rel" : "self"
"href" : "http://localhost:8080/products/1"
}
]
}
Edited:
By the way, you only need @EnableSpringDataWebSupport
annotation in this way.