KaotoIO / kaoto

The UI of the Kaoto project
https://kaoto.io
Apache License 2.0
29 stars 23 forks source link

Support in/out data types on source/sink in Pipe #844

Open christophd opened 6 months ago

christophd commented 6 months ago

Please describe the feature that you want to propose

A Pipe may declare in/out data types on a source or sink. The data type defines the data transformation that is automatically applied to the source/sink as part of the processing.

The Kaoto designer should be able to manage data type settings on a source and sink in a Pipe.

apiVersion: camel.apache.org/v1
kind: Pipe
metadata:
  name: timer-source-pipe
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: timer-source
    properties:
      period: 5000
      message: |
        { "client": "timer-pipe", "message": "Hello from timer-pipe!" }
    dataTypes:
      out:
        format: application-json
  sink:
    dataTypes:
      in:
        scheme: http
        format: application-cloudevents
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1
      name: log-sink
    properties:
      showHeaders: true

Each data type uses a format and an optional scheme. These properties will be used by Camel to lookup an available data type transformer implementation that performs the transformation logic. Available data type transformer implementations should be available in the Camel catalog.

When a scheme is used the data type transformer is component specific (e.g. http:application-cloudevents). When no scheme is given it uses a generic data type transformer (e.g. application-json).

The user is also able to use a / as a delimiter in the data type name in order to set as a content type setting.

...
  sink:
    dataTypes:
      in:
        scheme: http
        format: application/cloudevents
lordrip commented 6 months ago

There's another issue reported, pending to be linked

lordrip commented 6 months ago

Continuing from: https://github.com/KaotoIO/kaoto-next/issues/836