0

我已經宣佈爲JPA實體和到的FindAll(響應pagingandSortingRepository響應本)低於Pagingandsortingrepositrory在彈簧數據,在該實體的主鍵不

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

我不想_links和自[HATEOAS]的細節,但只是普通的JSON。 什麼是我應該設置這樣我在評論迴應

+1

http://stackoverflow.com/questions/23264044/disable-hypertext-application-language-hal -in-json –

+0

如果你想爲一個資源包含ID,那麼你可以在org.springframework.data.rest.core.config.RepositoryRestConfiguration –

+0

中啓用它。問題中的步驟,但只有標題中的內容類型會更改而不更改實際的JSON內容 – tamilnad

回答

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.

---作者:Alan乾草得到一個簡單的JSON屬性

相關問題