在版本2.0.2.RELEASE中使用带有JPA的Spring Data REST.
如何在JSON中禁用超文本应用程序语言(HAL)?http://stateless.co/hal_specification.html
我已经尝试了很多东西,但无济于事.例如,我已将Accept和Content-type标头设置为"application/json"而不是"application/hal + json",但我仍然收到带有超链接的JSON内容.
例如,我想得到类似的东西:
{
"name" : "Foo",
"street" : "street Bar",
"streetNumber" : 2,
"streetLetter" : "b",
"postCode" : "D-1253",
"town" : "Munchen",
"country" : "Germany",
"phone" : "+34 4410122000",
"vat" : "000000001",
"employees" : 225,
"sector" : {
"description" : "Marketing",
"average profit": 545656665,
"average employees": 75,
"average profit per employee": 4556
}
}
Run Code Online (Sandbox Code Playgroud)
代替:
{
"name" : "Foo",
"street" : "street Bar",
"streetNumber" : 2,
"streetLetter" : "b",
"postCode" : "D-1253",
"town" …Run Code Online (Sandbox Code Playgroud)