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

   `${body.sku}` on a map body threw `Method with name: sku not found on bean: 
{sku=CAMEL-MUG, qty=42}`. It is the loudest runtime failure in the AI route 
benchmark — 3582 occurrences in one 5-run series, more than every other runtime 
error together — and a frequent question, because jq, JavaScript and Groovy all 
read a map with a dot.
   
   A map now answers the key when it has no method of that name:
   
   ```
   ${body.sku}    // the sku entry, the same value ${body[sku]} gives
   ```
   
   The change is additive — only the path that throws today can now return a 
value:
   
   - **a method still wins**: `${body.size}` on a `Map` calls `size()` exactly 
as before, so nothing that works today changes
   - **an unknown name still fails**: the key must be present, so a misspelled 
field is still reported with the existing hint rather than silently answered 
with null
   - only a `MethodNotFoundException` triggers it, so a method that exists and 
throws is still a real error
   
   Tests in `SimpleSyntaxHintsTest`: the dot reads the key, a nested map reads 
through (`${body.item.sku}`), `size` still calls the method, and a missing key 
still carries the hint. `*Simple*Test` (615), `*Bean*Test` (481), `*Ognl*Test` 
(18) and the camel-bean module suite are green. Docs and the 4.23 upgrade guide 
updated.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj


-- 
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