davsclaus opened a new pull request, #27369:
URL: https://github.com/apache/camel/pull/27369

   https://issues.apache.org/jira/browse/CAMEL-25336
   
   A constant is used as written, so `${header.sku}` inside it stays the 
literal text: a route that answers `constant: '{"error": "unknown sku 
${header.sku}"}'` runs, and returns the placeholder. The YAML validator now 
reports it, next to the existing check for `${...}` in a script language, and 
shows the simple form:
   
   ```
   Line 10: constant: ${header.sku} is not evaluated, a constant is used as 
written: use simple: {expression: "{'error': 'unknown sku ${header.sku}'}"} for 
a value with expressions
   ```
   
   Not reported:
   - a constant set to a template header (`CamelVelocityTemplate`, 
`CamelThymeleafTemplate`, ...), whose `${...}` the template engine evaluates; 
the velocity and thymeleaf doc examples do this
   - `${HOME}`-style text, property placeholders, `resource:` constants
   
   ## Measured before opening
   
   | corpus | YAML documents | reports |
   |---|---|---|
   | this repository (files, `.adoc` blocks, Java/Groovy test text blocks) and 
camel-jbang-examples, camel-examples, camel-kamelets, camel-kamelets-examples, 
camel-kit, camel-k, Spring Boot and Quarkus examples | 5,804 | only the new 
test's own cases |
   | routes a local model wrote in the benchmark | 5,962 | 20, each a 
`${header.sku}`, `${exchangeProperty.orderId}` or `${body[qty]}` left as 
literal text |
   
   Tests: `ConstantWithSimpleTest` (3); the validator module suite passes (194).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to