spring-projects / spring-projects/spring-data-rest

Use JSON instead HAL in 3.6 version for projection

Open
#2,132 1 comment 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Sep 26, 2022.

status: waiting-for-triage
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.