eclipse-ee4j / eclipse-ee4j/jersey
If the same class appears in the object graph more than once, EntityFiltering incorrectly filters its properties
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
If objects of the same class appear more than once in the serialization graph, JacksonObjectProvider causes their properties to be filtered even if there are no filtering annotations present.
***test case***
The resource
```
@Path("test")
@Produces(MediaType.APPLICATION_JSON)
public class TestResource {
@GET
public Issue issue() {
return new Issue();
}
public static class Issue {
public Person reporter = new Person();
public Person assignee = new Person();
}
public static class Person {
public Address address = new Address();
}
public static class Address {
public Name name = new Name();
public String town = "Town";
}
public static class Name {
public String first = "John";
public String last = "Doe";
}
}
```
returns the following JSON document
```
{
"reporter":{
"address":{
"name":{
"first":"John",
"last":"Doe"
},
"town":"Town"
}
},
"assignee":{
"address":{
"town":"Town"
}
}
}
```
As you can see, even though assignee and reporter refer to equal objects, their "name" property is only serialized the first time.
#### Affected Versions
[2.18]
Contributor guide
Assessment
This issue has not been assessed yet.