davsclaus opened a new issue, #3117:
URL: https://github.com/apache/camel-kamelets/issues/3117

   ## Declare the in and out data types (`spec.dataTypes`) on the Kamelets that 
have none
   
   Only **19 of the 259 Kamelets** on `main` declare `spec.dataTypes`:
   
   | Type | Kamelets | With `dataTypes` |
   |---|---|---|
   | source | 99 | 16 |
   | sink | 98 | 3 |
   | action | 62 | 0 |
   
   The 19 are aws-cloudtrail-source, aws-ddb-sink, aws-ddb-streams-source, 
aws-s3-source, aws-sqs-source, azure-cosmosdb-source, azure-eventhubs-source, 
azure-storage-blob-source, azure-storage-datalake-source, 
azure-storage-files-source, azure-storage-queue-source, google-calendar-source, 
google-mail-source, google-sheets-sink, google-sheets-source, 
google-storage-source, ibm-cos-source, ibm-watson-language-sink and 
slack-source.
   
   ### Why
   
   A Kamelet's data type names a data type transformer through its `format`, 
such as `application-octet-stream`, `application-json` or 
`aws2-s3:application-cloudevents`. Camel turns the default type into the 
route's `inputType`/`outputType` (`KameletRoutesBuilderLoader`), so it is what 
the Kamelet takes and gives.
   
   Camel 4.24 adds the body types of the data type transformers to the Camel 
catalog (CAMEL-25928, https://github.com/apache/camel/pull/28449): what each 
transformer takes and what it leaves (text, bytes, a Map, a List, a POJO...). 
The Camel tools read a Kamelet's data types to learn its body from that catalog:
   - the YAML validator, which reports a step that cannot take the body before 
the route runs;
   - `camel_catalog_kamelet_doc` of the Camel MCP server, which AI assistants 
use.
   
   A Kamelet without `dataTypes` tells the tools nothing about its body, so 
they cannot help with it. That is 240 of the 259.
   
   ### What to do
   
   Add `spec.dataTypes` to the other Kamelets, with a `default` type and 
`types` whose `format` is an existing transformer:
   - **sources:** `out`, the body the source gives;
   - **sinks:** `in`, the body the sink takes;
   - **actions:** `in` and `out`.
   
   The transformers that exist today are listed in the Camel catalog (`camel 
catalog transformer`). The generic ones are:
   - `text-plain`, `application-octet-stream`;
   - `application-json`, `application-x-java-object`, `application-x-struct`;
   - `avro-*`, `protobuf-*`;
   - `application-cloudevents+json`;
   - the `<component>:application-cloudevents` ones.
   
   A source whose body is a binary payload would declare `binary` with 
`application-octet-stream`; one that gives JSON text would declare `json` with 
`application-json`.
   
   Where no transformer fits a Kamelet's body, that is worth a note on this 
issue, as it may need a new transformer in Camel.
   
   _Claude Code on behalf of davsclaus_
   


-- 
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