[ 
https://issues.apache.org/jira/browse/CAMEL-25560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-25560:
--------------------------------
    Fix Version/s: 4.24.0

> camel-yaml-dsl-validator - a key given twice in one mapping is reported, as 
> YAML keeps only the last one
> --------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-25560
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25560
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-yaml-dsl
>            Reporter: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.24.0
>
>
> A key written twice in one mapping passes validation: the validator reads the 
> YAML into a tree where the last value wins, and the YAML DSL loads the route 
> the same way, so the first value is lost without a word.
> Found in the local-model benchmark, where an edit added a new message under a 
> log and left the old one:
> {code:yaml}
> - log:
>     message: "  pick ${body[qty]} x ${body[sku]} for ${header.orderId}"
>     message: "  pick ${body[qty]} x ${body[sku]}"
> {code}
> The route runs and logs the old message. Another file had two when: keys in 
> one choice, so one branch was gone.
> The validator should report it with both lines, for example: line 22: 
> message: is given twice in this log: (lines 21 and 22); YAML keeps only the 
> last one, so the message: at line 21 is lost.
> The validator Maven plugin does not fail the build on errors by default 
> (failOnError=false).



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

Reply via email to