Currently @JsonIgnoreType on a type/mixin causes that an object of this
type is not serialized if it's another object's property, e.g.:
public class Foo {
public Bar bar;
}
@JsonIgnoreType
public class Bar {
public String a;
}
and serialized Foo is an empty object "{}" (that's great so far)
*Would it make sense to extend this feature so that Bar is not serialized
when it's a part of an array (or collection)?*
Object[] arr = new Object[] {bar};
mapper.writeValueAsString(arr);
"[]"
*or even when serialized directly?*
mapper.writeValueAsString(bar);
""
I can easily get this output using custom serializer, but it feels kinda
bad to write custom serializer if you want to ignore the type completely..
What do you think?
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.