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

Adriano Machado commented on CAMEL-24826:
-----------------------------------------

PR: https://github.com/apache/camel/pull/26616

Covers the validate check (SimpleChecks, so camel validate and the MCP tool 
report the same message), the corrected ternary documentation, the unquoted 
number/boolean branch parse bug, and the validate/runtime divergence.

_Claude Code on behalf of Adriano Machado (@ammachado)_

_This was generated by an AI agent and may contain inaccuracies. Please verify 
before relying on it._


> camel validate: flag a ternary operator in a Simple expression, it is not 
> supported and comes out as literal text
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24826
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24826
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core, camel-jbang
>            Reporter: Claus Ibsen
>            Assignee: Adriano Machado
>            Priority: Major
>
> Found twice while writing examples for CAMEL-24808 and in the local-model 
> benchmark.
> Simple has no ternary operator, but a model, and a human copying from another 
> language, writes one:
> {code}
> setBody:
>   expression:
>     simple:
>       expression: "${body.size()} == 0 ? ${null} : ${body[0]}"
> {code}
> At runtime this evaluates to the literal text "1 == 0 ?  : {sku=CAMEL-MUG, 
> qty=42}" and is silently used as the body; a nested form inside a function 
> fails at runtime with "Unknown function". *camel validate yaml* (and the 
> validate tool of the MCP server) accepts both.
> Proposal: the Simple language validator (parse or a dedicated check) reports 
> a " ? " with a " : " at the top level of an expression as "Simple has no 
> ternary operator; use a choice, or a jsonpath/groovy expression", with the 
> position. Same message from the MCP validate tool.



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

Reply via email to