spring-projects / spring-data-rest

Simplifies building hypermedia-driven REST web services on top of Spring Data repositories
https://spring.io/projects/spring-data-rest
Apache License 2.0
915 stars 561 forks source link

json reply contains extra content compared to hal+json [DATAREST-1207] #1568

Open spring-projects-issues opened 6 years ago

spring-projects-issues commented 6 years ago

Norbert Somlai opened DATAREST-1207 and commented

This request users/search/name?name=x has returns an empty collection yet there is a content array when default-media-type is application/json:

{
  "links" : [ {
    "rel" : "self",
    "href" : "http://localhost:8080/backend/api/users/search/name?name=x"
  } ],
  "content" : [ {
    "rel" : null,
    "collectionValue" : true,
    "relTargetType" : "com.xxx.backend.model.User",
    "value" : [ ]
  } ]
}

application/hal+json works fine:

{
  "_embedded" : {
    "users" : [ ]
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/backend/api/users/search/name?name=x"
    }
  }
}

Affects: 3.0.4 (Kay SR4)

spring-projects-issues commented 6 years ago

Norbert Somlai commented

Sorry, wrong project. Wanted to add to Spring Data Rest

spring-projects-issues commented 5 years ago

Ben Madore commented

Looks like the same issue as DATAREST-1346