Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7858

Allow to disable Jaxb annotations in JacksonDataFormat

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.14.0
    • 2.15.0
    • camel-jackson
    • None
    • Unknown

    Description

      The existing code of camel jackson dataformat does not support that we
      disable the JaxbAnnotationModule()

      public JacksonDataFormat(Class<?> unmarshalType, Class<?> jsonView) { 
              this.objectMapper = new ObjectMapper(); 
              this.unmarshalType = unmarshalType; 
              this.jsonView = jsonView; 
      
              // Enables JAXB processing 
              JaxbAnnotationModule module = new JaxbAnnotationModule(); 
              this.objectMapper.registerModule(module); 
          } 
      

      If we have an attribute like this:

      @XmlAttribute(name = "has-children", required = true) 
      private Boolean hasChildren; 
      

      In previous version (2.9.7 for instance):

      XML: "has-children" 
      Json: "hasChildren" 
      

      In the current one (2.14.0):

      XML: "has-children" 
      Json: "has-children" 
      

      Attachments

        Activity

          People

            njiang Willem Jiang
            namador Nicolás Amador
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: