christophd opened a new pull request, #4100:
URL: https://github.com/apache/camel-k/pull/4100

   - Adds input/output/error data type spec to Kamelet CRD. The data type 
specifications provides additional information to the user such as what kind of 
input is required to use a Kamelet and what output is produced by the Kamelet.
   - The data type specifications can be used by tooling and data type 
converters to improve the overall usability of Kamelets
   - Deprecate former types field and EventTypeSpec
   
   Fixes #1980 
   
   Sample source Kamelet using the new dataTypes structure:
   
   ```yaml
   apiVersion: camel.apache.org/v1alpha1
   kind: Kamelet
   metadata:
     name: event-source
     labels:
       camel.apache.org/kamelet.type: "source"
   spec:
     definition:
       title: "Event"
       description: "Source uses different output data types"
       required:
         - token
       properties:
         token:
           title: Token
           description: The authentication token
           type: string
     dataTypes:
       out:
         headers:
           eventId:
             title: "Event Id"
             description: "The id of the event"
             type: string
           eventSubject:
             title: "Event Subject"
             description: "The event subject"
             type: string
         types:
           json:
             mediaType: application/json
             dependencies:
               - camel:jackson
             schema:
               # the JSON schema
           binary:
             mediaType: application/octet-stream
             headers:
               compressed:
                 title: Data Compression
                 type: boolean
                 default: false
         default: json
     template:
       from:
         uri: "kamelet:source"
         steps:
           [...]
   ```
   
   The dataTypes section may define message headers that the Kamelet produces. 
Also the section defines one to many supported data types for in/out/error. In 
the sample two data types are defined for the source Kamelet as an output (json 
and binary). Each data type specification is able to define a mediaType, 
additional dependencies, headers and a schema.
   
   In a KameletBinding users may choose the output data type when referencing 
the Kamelet:
   
   ```yaml
   apiVersion: camel.apache.org/v1alpha1
   kind: KameletBinding
   metadata:
     name: event-binding
   spec:
     source:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: event-source
         dataTypes:
           out: 
             format: binary
     sink:
       ref:
         kind: Kamelet
         apiVersion: camel.apache.org/v1alpha1
         name: event-sink
   ```
   
   The binding explicitly defines the output data type on the `event-source` 
Kamelet reference. The Kamelet source produces the output as `binary` 
accordingly.
   
   Same applies for input data types where the Kamelet reference in a binding 
may choose from different supported input types of a Kamelet.
   
   **Release Note**
   ```release-note
   feat: Support data types in Kamelets
   ```
   


-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to