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

   ## What
   
   [CAMEL-25928](https://issues.apache.org/jira/browse/CAMEL-25928), the last 
small item of the EIP body types: the body of a Kamelet, from its data types.
   
   Stacked on #28449, which gives the data type transformers their body types.
   
   A Kamelet's data types (`spec.dataTypes`) name a data type transformer with 
their `format`, such as `application-octet-stream` or 
`aws2-s3:application-cloudevents`. `KameletRoutesBuilderLoader` makes the 
default `in` and `out` type the `inputType`/`outputType` of the Kamelet route, 
so Camel runs those transformers at its start and end. The transformers' body 
types therefore say what the Kamelet takes and gives, and no new metadata is 
needed.
   
   ### Changes
   
   - **jbang-core** reads the data types (`KameletDataTypeModel`):
     - catalog Kamelets through the CRD getters, in `KameletCatalogHelper`;
     - the project's `.kamelet.yaml` files, in `KameletDefinitions`.
   
     The scheme and the format are joined as Camel does.
   - **The YAML validator** gets the default in/out transformer of each Kamelet 
through `ProjectFacts.kamelets`. `ValidatorFacts` reads them only when the file 
uses a Kamelet.
     - `from: kamelet:x` starts with the body of its out data type.
     - `to: kamelet:x` and the `kamelet` EIP report a body their in data type 
cannot take, and leave the body of the out one. A CloudEvent data type keeps 
the body.
   - **`camel_catalog_kamelet_doc`** (MCP) and **`camel_catalog_doc` / `camel 
doc`** for a Kamelet list its data types. Each entry has:
     - the direction;
     - the transformer (format);
     - whether it is the default;
     - the body it takes or gives, taken from the catalog.
   - **Docs:** the Message Body Types page and the MCP tool table.
   
   A Kamelet without data types says nothing about its body, as before. Only 19 
of the 259 Kamelets have data types today, so apache/camel-kamelets#3117 asks 
for them on the rest.
   
   ## Tests
   
   - Validator: 312 tests pass, including `TextBodyFlowTest`:
     - a Kamelet source gives its out data type;
     - a sink needs its in data type;
     - a kamelet step leaves its out data type, and a CloudEvent one keeps the 
body.
   - jbang-core: 752 AI tests pass. The new `KameletDataTypesTest` covers the 
data types of a project Kamelet, the doc with the body of each, and the 
validator walking a `from: kamelet:` route end to end.
   - camel-jbang-mcp: `KameletToolsTest.theDataTypesOfAKamelet` checks the 
aws-s3-source data types and their bodies. The class runs locally only, because 
it downloads the Kamelet catalog.
   
   _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