FasterXML / FasterXML/jackson-databind
@JsonIgnoreProperties does not stack
- Lenguaje dominante
- Java
- Estrellas
- 3.7k
- Forks
- 1.5k
- Merge medio
- 3 d 6 h
- PR fusionados (30 d)
- 28
Descripción
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`?
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.