Claus Ibsen created CAMEL-24883:
-----------------------------------

             Summary: camel-jbang - the validator's Simple checks skip 
expressions written as YAML block scalars
                 Key: CAMEL-24883
                 URL: https://issues.apache.org/jira/browse/CAMEL-24883
             Project: Camel
          Issue Type: Bug
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.23.0


The Simple checks of the camel-jbang validator 
({{SimpleChecks.validateYamlSimple}}: top-level ternary, a placeholder as a 
logical operand, and the other Simple rows) read the expression from the inline 
forms only, {{simple: "..."}} and {{expression: "..."}}. An expression written 
as a YAML block scalar is skipped:

{code}
- setBody:
    expression:
      simple: |
        ${exchangeProperty.CamelTimerCounter} == 0 ? 'resource:file:order.json' 
: 'resource:file:order-bad-email.json'
{code}

In the camel-jbang-mcp stepwise benchmark (transform/groovy) the same top-level 
ternary was refused with the right hint when written inline (run 2) and 
accepted when written as a block scalar (run 4); the route then failed at 
runtime and the model gave up on Simple and rewrote the step in Groovy, where 
it hit CAMEL-24882.

Read block scalars ({{|}}, {{|-}}, {{>}}, {{>-}}) for {{simple:}}, 
{{expression:}} under a simple key, and {{message:}} of log, joining the 
indented lines, so every Simple row applies to both forms. The endpoint and 
expression checks that read a value the same way should get the same treatment.



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

Reply via email to