davsclaus opened a new pull request, #26780:
URL: https://github.com/apache/camel/pull/26780
A route reached with `direct:` has the body of its caller. When the caller
has none — a REST GET, a timer — a `jsonpath` or `jq` step in that route has
nothing to read, and the message named the mechanisms without saying what to
write:
```
The jsonpath expression got no message body to evaluate (the body is null):
read the JSON before the step
with poll: file:..., pollEnrich or a from: consumer, or set it with setBody
```
"set it with setBody" is the answer for the common case — a file the route
knows the name of — and it doesn't say what goes in the setBody. Now:
```
The jsonpath expression got no message body to evaluate (the body is null):
a route reached with direct: has
the body of its caller, so when the caller has none, read the data first -
setBody with
constant: resource:file:data.json for a known file, or poll:, pollEnrich or
a from: consumer for one that is not
```
Same wording in `JqExpression`.
**Why it's worth the words.** In the AI route benchmark this exact failure
produced **24 exceptions per run across five runs** on one rung — the model
read the message every time and never added the read, because the message named
the mechanism and not the form. Both forms in the new text were verified by
running them, not by reading the docs: `setBody: constant:
resource:file:stock.json` fills the body with the file's text and jsonpath then
reads it; `poll: {uri: file:inbox, parameters: {delete: true}}` reads the file
and deletes it.
Tests: `JsonPathNullBodyHintTest` and `JqNullBodyHintTest` now assert the
form (`constant: resource:file:`), the alternative (`poll:`) and the reason
(`has the body of its caller`). Both modules green.
Follows CAMEL-24838, which added the original hint.
🤖 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]