FasterXML / FasterXML/jackson-databind
@JsonIgnoreProperties does not stack
- Dominant language
- Java
- Stars
- 3.7k
- Forks
- 1.5k
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 28
Description
I'd like to be able to aggregate `@JsonIgnoreProperties`, but it looks like it's only accepting the "top" one.
Here's a test case:
```
@JsonIgnoreProperties(value = { "generated" }, allowGetters = true)
static class BaseBean {
public String getGenerated() {
return "http://bar.com";
}
}
@JsonIgnoreProperties(value = { "computed" }, allowGetters = true)
static class ReadOnlyBean extends BaseBean {
public int getComputed() {
return 32;
}
}
@Test
public void testReadOnlyProp() throws Exception {
ObjectMapper m = new ObjectMapper();
String json = m.writeValueAsString(new ReadOnlyBean());
assertTrue(json.contains("generated"));
assertTrue(json.contains("computed"));
ReadOnlyBean bean = m.readValue(json, ReadOnlyBean.class);
assertNotNull(bean);
}
```
When the `@JsonIgnoreProperties` is on a mixin, the mixin's annotation trumps all.
Would it be possible to aggregate all the `@JsonIgnoreProperties`?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.