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

   CAMEL-25748: a model often writes a script file as a property of the 
language, which the schema does not have:
   
   ```yaml
   - setBody:
       expression:
         groovy:
           resource: "file:shipment-mapping.groovy"
   ```
   
   The hint for a language text under another key (from #27666) copied the 
value into `expression:`. It said `write groovy: {expression: 
"file:shipment-mapping.groovy"}`. That form is wrong: without the `resource:` 
prefix, Groovy runs `file:shipment-mapping.groovy` as code.
   
   In the overnight benchmark of Oct 17-18, this hint came up in 5 of 10 runs 
of one step. Two of those runs failed the step at the call limit, one of them 
after 22 refused writes. Across all benchmark series, 46 hints dropped the 
prefix.
   
   ## What
   
   - **A script file keeps the `resource:` prefix in the hint**, and the hint 
says why: `a groovy script file is loaded in expression: with the resource: 
prefix, write groovy: {expression: "resource:file:shipment-mapping.groovy"}`.
   - **When it applies:** a value under `resource:` or `resourceUri:`, or a 
`file:`, `classpath:` or `http(s):` value under `script:`. These are the keys 
models used in the benchmark traces.
   - **Unchanged:** inline code (`script: "body.find { ... }"`) and a value 
that already has the prefix keep the hint as before.
   
   ## Tests
   
   - `QuotingAndOptionPlacementHintTest.aScriptFileUnderAnotherKey` (new): 
`resource:` with `file:`, `script:` with `classpath:`, and a value that already 
has `resource:` (kept once).
   - All camel-yaml-dsl-validator tests pass (245). No test in camel-jbang 
depends on the hint text.
   
   🤖 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