You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2025/04/26 08:37:00 UTC

[jira] [Commented] (CAMEL-22022) camel-jacksonxml - Transform from XML to JSon can we preserve order of elements

    [ https://issues.apache.org/jira/browse/CAMEL-22022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17947487#comment-17947487 ] 

Claus Ibsen commented on CAMEL-22022:
-------------------------------------

We should use LinkedHashMap instead of HashMap by default as unmarshalType

> camel-jacksonxml - Transform from XML to JSon can we preserve order of elements
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-22022
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22022
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-jacksonxml
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.12.0
>
>
> {code:java}
> - route:
>     from:
>       uri: timer
>       parameters:
>         repeatCount: "1"
>         timerName: yaml
>       steps:
>         - setBody:
>             simple:
>               expression: |-
>                 <test>
>                   <b>2</b>
>                   <a>1</a>
>                 </test>
>         - unmarshal:
>             jacksonXml: {}
>               # useList: true
>               # collectionType: java.util.LinkedHashMap
>         - marshal:
>             json: {}
>         - log: ${body} {code}
> {{b}} and {{a}} are changed in position
> Can we try to see if we can make jacksonXml keep the order, so its the same as the input.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)