spring-projects / spring-projects/spring-data-rest
Use JSON instead HAL in 3.6 version for projection
@odrotbohm is already working on this.
Since Sep 26, 2022.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Hello. My problem is that I got response in HAL format for projections (Entity's are in JSON) using spring boot + data-rest.
My project configuration include next params:
spring:
data:
rest:
default-media-type: application/json
hateoas:
use-hal-as-default-json-media-type: false
I've got answer from endpoint in format like:
{
"dateIn": "2021-10-25T10:43:32.021",
"stopList": "1",
"devicesInfo": [
{
"id": 2,
"ipAddress": "192.167.1.1",
"countryCode": "643",
"deviceType": "web",
"deviceName": "Dell ",
"deviceModel": "G5 3500"
}
],
"links": [
{
"rel": "self",
"href": "http://localhost/api/afNonPayments/1"
},
{
"rel": "afNonPayment",
"href": "http://localhost/api/afNonPayments/1{?projection}"
}
]
}
The devicesInfo section is the simple entity, and there is no links attribute.
But the full object is projection, and its JSON representation contains links section, which I want to remove. Is any way to make it?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.