davsclaus opened a new pull request, #28042:
URL: https://github.com/apache/camel/pull/28042
CAMEL-25746: in the overnight benchmark of Oct 17-18 (ten runs of a local
model on the example ladder), 3 of the 8 failed steps of the contract-first
openapi example hit errors that name the problem but not the fix. A model reads
these errors and tries again, so the fix in the message matters, as it does for
people.
## What
- **"Key: x not found in bean"** (`BeanExpression`, which Simple uses for
`${body[x]}` and `${variable.v[x]}`) adds a hint after the message:
- **A stream or bytes:** "the value is the message body as a stream, not a
Map: unmarshal it first, for example with json, then read the key; a variable
keeps the value it had when it was set". In the benchmark, a variable was set
from the request body before the `unmarshal`, and the step answered 500.
- **JSON text** (starts with `{` or `[`): "unmarshal it first". Other text
keeps the message as it was.
- **A List:** "a List has no keys: pick an element first, such as
[0][qty], or split the list".
- **platform-http:** a Map or List as the response body now says "(a List is
not an HTTP response body: marshal it to JSON first (marshal: json) or set the
body to the JSON text)". This matches the http producer's message for a request
body (CAMEL-25309). The exception type stays
`NoTypeConversionAvailableException`.
## Tests
- `SimpleTest`: three new tests (a stream, JSON text, a List). The existing
exact-message tests for plain text pass unchanged. 209 tests.
- `VertxPlatformHttpResponseBodyHintTest` (new): a List, a Map, and another
body that keeps the plain message. All platform-http-vertx tests pass (162).
- camel-bean tests pass.
🤖 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]