0

I have declared pagingandSortingRepository for a JPA entity and the response to findall() is below

"_embedded" : {
    "assetDashboardCustomers" : [ {
      "utilization" : "80",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/utilbycustomer/Customer01"
        },
        "assetDashboardCustomer" : {
          "href" : "http://localhost:8080/utilbycustomer/Customer01"
        }
      }
    },

I do not want _links and self [HATEOAS] details, but just the plain JSON. What is the property I should set so that I get a plain JSON in the response

Ganesh
  • 1,654
  • 2
  • 19
  • 32
  • 1
    http://stackoverflow.com/questions/23264044/disable-hypertext-application-language-hal-in-json – Alan Hay Nov 04 '16 at 09:06
  • If you want ti include ID for a resource then you can enable this in org.springframework.data.rest.core.config.RepositoryRestConfiguration – Alan Hay Nov 04 '16 at 09:21
  • I followed the steps in the question, but only the content type in the header changes and not the actual JSON content – Ganesh Nov 04 '16 at 09:38
  • 1
    The first comment answers your first question - you cannot turn off the links. The second comment answers you 2nd question which is how to have the ID in the JSON body. – Alan Hay Nov 04 '16 at 10:02
  • Thanks for the answers, I configured to display the Ids. – Ganesh Nov 07 '16 at 09:19

1 Answers1

0

The first comment answers your first question - you cannot turn off the links. The second comment answers you 2nd question which is how to have the ID in the JSON body.

--- By Alan hay in the comments

Ganesh
  • 1,654
  • 2
  • 19
  • 32