Claus Ibsen created CAMEL-25402:
-----------------------------------
Summary: camel-yaml-dsl-validator - Say how to write expression:
when it is given text instead of a language
Key: CAMEL-25402
URL: https://issues.apache.org/jira/browse/CAMEL-25402
Project: Camel
Issue Type: Improvement
Components: camel-yaml-dsl
Reporter: Claus Ibsen
Fix For: 4.23.0
When the expression: key of an EIP (split, setHeader, setBody, filter, ...) is
given text, the YAML DSL validator reports only:
{noformat}
Line 6: /0/route/from/steps/0/split/expression: string found, object expected
Line 6: /0/route/from/steps/0/split/expression: string found, object expected
{noformat}
The message is reported twice and does not say what to write. Examples:
{code}
- split:
expression: "${body}"
- setHeader:
name: CamelHttpResponseCode
expression: constant 404
{code}
The validator already has a hint for expression options such as handled and
completionSizeExpression, but not for the expression: key of an EIP.
Proposal: report it once, with the form to write, e.g.
{noformat}
a plain value (constant 404) found, a language expected: expression: holds the
language as its key, write expression: {constant: {expression: "404"}}
{noformat}
simple when the text contains ${, constant otherwise, and a language name in
front of the text (constant 404) is used as the language.
Found in the local model benchmark (qwen3.6:35b-a3b through the camel-jbang-mcp
server): the model met this message in 10 steps of the r6 ladder run and kept
rewriting the same YAML (92 refused writes), failing csv-to-json and
openapi-server steps.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)