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

   [CAMEL-25322](https://issues.apache.org/jira/browse/CAMEL-25322)
   
   **The problem:** since CAMEL-24916, `${body.orderId}` on a Map reads the 
key. So when this lookup fails, the key is missing. The bean language still 
added the hint written before that change:
   
   ```
   Failed to invoke method: orderId (the value is a Map: a key is read with 
[orderId], as in ${body[orderId]}, not with .orderId) ...
   ```
   
   That points the wrong way: the dot is fine, and `${body[orderId]}` would 
just give null. In the local-model benchmark (http-client, openapi-client) the 
model got this inside a split over an order's lines. There the body is a line 
(`sku, qty, price`), not the order, and the model kept switching between the 
two forms.
   
   **The change:** the hint now says what is true and shows the keys:
   
   ```
   Failed to invoke method: missingKey (the Map has no key missingKey; its keys 
are: orderId, lines) ...
   ```
   
   - At most 20 keys are listed, then the total count.
   - An empty Map gets "it is empty".
   
   **Tests:**
   - `SimpleSyntaxHintsTest` is updated for the new wording, and a new test 
covers the empty Map.
   - camel-core's Simple, bean and OGNL tests pass (1158), and so does the 
camel-bean module build.
   - Checked live with `camel run`.
   
   🤖 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