davsclaus opened a new pull request, #28048: URL: https://github.com/apache/camel/pull/28048
## What [CAMEL-25751](https://issues.apache.org/jira/browse/CAMEL-25751), quick win 3 of the plan on [CAMEL-24844](https://issues.apache.org/jira/browse/CAMEL-24844). The platform-http reply and the file producer cannot write a Map or a List (a body unmarshalled from JSON, or built as a map). Until now they only named the conversion: ``` NoTypeConversionAvailableException: No type converter available to convert from type: java.util.LinkedHashMap to the required type: java.io.InputStream ``` They now say what to do, in the same way as the http producer since CAMEL-25309: - **camel-platform-http-vertx** (`VertxPlatformHttpSupport.writeResponseAsFallback`): `... java.io.InputStream: a Map is not an HTTP response body: marshal it to JSON first (marshal: json) as the last step of the route, or let the REST binding write it (bindingMode: json)` - **camel-file** (`FileOperations.storeFile`): `Cannot store file: /out/order.json: No body available of type: java.io.InputStream but has type: java.util.LinkedHashMap on: ... (a Map is not file content: marshal it first (marshal: json) or set the body to the text)`. The "Cannot store file" wrapper now carries the cause's message when the body cannot be read as a stream. Before, the reason was only in the "Caused by" of the stack trace. The hint is only added to a conversion that already fails, and only for a Map or a Collection body. Other bodies keep their current message. ## Why In the r17 series of the local-model benchmark (2026-10-17/18), 17 of the 210 example runs hit a body type collision. 5 of them failed at exactly these two places (3 platform-http replies, 2 file writes), and all 5 failed the step. For the http producer, the CAMEL-25309 sentence let the model recover in 5 of 6 runs of one example. The static side of the same collision is in the validator (#28047). CAMEL-25749 later moves these sentences onto one shared helper. ## Tests - `VertxPlatformHttpMapResponseTest`: a Map and a List reply; the exception the consumer reports carries the sentence. Module: 160 tests, 0 failures. - `FileProducerMapBodyTest`: a Map body, a List body through the charset (reader) path, and a plain object that keeps its message. Module: 27 tests, 0 failures. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
