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

Claus Ibsen commented on CAMEL-25222:
-------------------------------------

PRs: main https://github.com/apache/camel/pull/27198 , backport to 4.22.x 
https://github.com/apache/camel/pull/27199 (the console change is ported by 
hand on 4.22.x, see the PR).

_Claude Code on behalf of davsclaus_

> Route dump - YAML with source locations loses the list dash of a choice when, 
> and throwException given an exception instance is dumped empty
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-25222
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25222
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.22.2, 4.23.0
>
>
> Two problems in the route dump (route-dump dev console, camel cmd route-dump, 
> camel transform, the TUI YAML/XML view of a route).
> *1. The YAML dump with source locations loses the dash of a list item*
> The route-dump dev console asks for the YAML with source locations and then 
> drops the sourceLineNumber and sourceLocation lines, moving the line number 
> to the line before. When those keys come first in a list item, as in a when 
> of a choice, the dropped line is the one with the dash:
> {code}
>             when:
>               - sourceLineNumber: 14
>                 sourceLocation: OrderRoute.java
>                 expression:
> {code}
> becomes
> {code}
>             when:
>                 expression:
>                   simple:
>                     expression: "${body} == 9"
>                 steps:
> {code}
> so the when is a map instead of a list item, which is not valid YAML DSL, and 
> the line number lands on the when: line instead of the item. Seen with camel 
> cmd route-dump --format=yaml and in the TUI. camel transform is not affected 
> as it does not dump source locations.
> *2. throwException with an exception instance is dumped empty*
> {code:java}
> .throwException(new IllegalStateException("Out of stock"))
> {code}
> is dumped as throwException: {} in YAML and <throwException/> in XML, as the 
> model writers only write exceptionType, message and ref. The dumped route 
> loses the exception and cannot be loaded back. The dumpers can write the 
> exceptionType and message of the exception instance when neither 
> exceptionType nor ref is set.
> _Claude Code on behalf of davsclaus_



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

Reply via email to