バージョン 2.0.2.RELEASE の JPA で Spring Data REST を使用する。
JSON で Hypertext Application Language (HAL) を無効にするにはどうすればよいですか? http://stateless.co/hal_specification.html
私はすでに多くのことを試しましたが、役に立ちませんでした。たとえば、Accept ヘッダーと Content-type ヘッダーを "application/hal+json" ではなく "application/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
}
}
それ以外の:
{
"name" : "Foo",
"street" : "street Bar",
"streetNumber" : 2,
"streetLetter" : "b",
"postCode" : "D-1253",
"town" : "Munchen",
"country" : "Germany",
"phone" : "+34 4410122000",
"vat" : "000000001",
"employees" : 225,
"_links" : {
"self" : {
"href" : "http://localhost:8080/app/companies/1"
},
"sector" : {
"href" : "http://localhost:8080/app/companies/1/sector"
}
}
}
ご協力いただきありがとうございます。