-
Notifications
You must be signed in to change notification settings - Fork 20
JaxbAnnotationIntrospector creates an element from an attribute instead of an attribute #27
Comments
Division of labor should be quite straight-forward: JAXB module only recognized JAXB annotations; and other modules recognized annotations they add, so Jackson XML module's introspectors understand annotations defined there. JAXB module (this project) has no dependency to Jackson XML module, and so can not technically handle annotations from it. The canonical way to use both annotations is to use two (or more) But XML module does depend on JAXB annotations module for historical reasons, so it is true that |
Just realized that test case referred did use both sets of annotations, but only to demonstrate the issue. So I will try to see if I can reproduce the issue. |
Ah. Yes, I can reproduce the problem. Will need to see whether it can be fixed, or if it requires documentation -- I don't know off-hand. Thank you for helping reproduce this problem! |
Ok: I was able to not only reproduce the issue, but actually fix it. Unfortunately needed changes mean this is 2.4-only fix (see FasterXML/jackson-dataformat-xml#111). |
This is a duplicate of issue #6 for jackson version 2.3.2; the comments on that bug report ended with it not being reproducible.
Please see the junit test and classpath being used in my stackoverflow question: http://stackoverflow.com/questions/22433679/how-to-use-jacksons-jaxbannotationintrospector-correctly
Someone answered my stackoverflow question saying that com.fasterxml.jackson.dataformat.xml.jaxb.XmlJaxbAnnotationIntrospector seems to work fine. I confirmed that when I replace JaxbAnnotationIntrospector with XmlJaxbAnnotationIntrospector in my junit test I get the expected output.
Since there is a solution (use XmlJaxbAnnotationIntrospector) maybe the quickest fix is to update the documentation to suggest using XmlJaxbAnnotationIntrospector in cases where the XML output from JaxbAnnotationIntrospector is not in line with the JAXB annotations.
The text was updated successfully, but these errors were encountered: