jackson-dataformat-xml icon indicating copy to clipboard operation
jackson-dataformat-xml copied to clipboard

Serialization of List incorrect if property declared as non-Collection (Object)

Open cowtowncoder opened this issue 14 years ago • 1 comments

(as reported by Paweł Kowol on Jackson users list)


If a List (or other Collection) is value of a non-Collection property, like so:

public class Bean {
  public Object list;
}

it will not be serialized correctly. This is most likely due to special handling of Collection types, which is triggered based on declared type of property (since it must be added statically when constructing bean serializers). Will need to see if this can be improved.

cowtowncoder avatar Mar 22 '11 23:03 cowtowncoder

Yup; easy enough to show with unit test. Wonder what to do, if anything: certainly possible to override "untyped serializer", but won't help a lot with deserialization...

cowtowncoder avatar Mar 07 '12 23:03 cowtowncoder