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

   Stacked on #28242. This is the documentation part of the catalog body types 
(CAMEL-24961): the pages of the components, data formats and languages show 
their body types, and so does `camel catalog doc`.
   
   **On the website.** Each component, data format and language page with body 
types in the catalog gets a **Message Body** section. A page without body 
types, such as jdbc, has no section.
   - The section has a table with a row per side: Consumer, Consumer reply, 
Producer input and Producer output; or Marshal and Unmarshal input and output; 
or Expression input and result.
   - Each row gives:
     - the carriers, with the Java type when the body is always of that type;
     - the description;
     - the body for other values of an option (`With output=bytes: bytes 
(byte[])`);
     - the options the body depends on (`Not known when source is set`).
   
   | Side | Body | Description |
   |---|---|---|
   | **Consumer** | `file` | The file as read: a GenericFile (a java.io.File 
with preMove), which converts to text, bytes or a stream. |
   | **Producer input** | `text`, `bytes`, `stream` or `file` | What converts 
to an InputStream: text, bytes, a stream or a file. A Map or a List fails: 
marshal it first. With `allowNullBody=true`: `null`, `text`, `bytes`, `stream` 
or `file` |
   | **Producer output** | `unchanged` | |
   
   (the File page; screenshots of the rendered pages follow in a comment)
   
   **How it is built**
   - A new partial, `body-types.adoc`, renders the `bodyTypes` section of the 
catalog JSON with the jsonpath extension of the website, as the message headers 
table does. The JSON comes through the same links to each module's generated 
JSON.
   - The components partial includes it after the message headers; the data 
formats and languages partials include it after the options. So no doc page 
changes.
   - `camel.js` gets three helpers that render a side: its name, its carriers 
and Java type, and the description with the option values and the options it 
depends on. They escape only what AsciiDoc would read as an attribute 
(`{body}`, not `{header.foo}`).
   
   **In the terminal.** `camel catalog doc` prints the same table after the 
message headers of a component, and after the options of a data format or 
language. It uses the compact lines of `camel_catalog_doc`.
   
   **Checked** with a local Antora build of the components docs, with the 
website's extensions and UI:
   - the pages of file, http, platform-http, timer, kafka, sql, kamelet, 
jackson, csv, xpath, jq and simple show the section;
   - jdbc shows none;
   - the build has no message about the new partial or the helpers.
   
   **Tests:** `CatalogDocTest.shouldPrintTheMessageBody` (file, jackson, and 
jdbc without a table), and the catalog doc tests of camel-jbang-core (49).
   
   Docs: the Camel Catalog page says the pages and `camel catalog doc` show the 
body types.
   
   _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]

Reply via email to