Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.0.0
-
Fix Version/s: None
-
Component/s: ObjectMapper, Serializer
-
Labels:None
-
Number of attachments :
Description
In previous versions of jackson (1.8.x), XML accessor type NONE defined at traits or abstract class is completely ignored while serializing the classes that use them.
With Jackson 2.0.0, the annotation is propagated to the parent classs.
Example: In the following example, main class doesn't have any Accessor annotation however serializing ScalaClassForJacksonTest only serializes siteId property
@XmlAccessorType(XmlAccessType.NONE)
trait JacksonTestTrait
@XmlRootElement(name = "scalaClassForJackson2Serialization")
class ScalaClassForJacksonTest extends JacksonTestTrait{
def this(documentId: String,
title: String,
description: String,
siteId: String
) =
@BeanProperty var title: String = _
@BeanProperty var description: String = _
@BeanProperty var documentId: String = _
}
Is this the expected behavior? Ideally I would like to apply the Accessor type scope to the class or trait where it is defined.
I will have to think about this... JAXB annotation support is fundamentally problematic since JAXB semantics differ from Jackson (annotation) semantics.