This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit fff5a58beb830f0714f74ac37e58505456bec6da
Author: nicolaferraro <[email protected]>
AuthorDate: Thu May 13 12:21:48 2021 +0200

    add content type and fix generated message
---
 test/insert-field-action/insert-field-action-binding.yaml |  3 ++-
 timer-source.kamelet.yaml                                 | 11 ++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/test/insert-field-action/insert-field-action-binding.yaml 
b/test/insert-field-action/insert-field-action-binding.yaml
index 2e111d8..de2fd2b 100644
--- a/test/insert-field-action/insert-field-action-binding.yaml
+++ b/test/insert-field-action/insert-field-action-binding.yaml
@@ -9,7 +9,8 @@ spec:
       kind: Kamelet
       name: timer-source
     properties:
-      message: "thecontent"
+      message: '{"content": "thecontent"}'
+      contentType: "application/json"
   steps:
   - ref:
       apiVersion: camel.apache.org/v1alpha1
diff --git a/timer-source.kamelet.yaml b/timer-source.kamelet.yaml
index 06d3aaf..be6057c 100644
--- a/timer-source.kamelet.yaml
+++ b/timer-source.kamelet.yaml
@@ -44,9 +44,11 @@ spec:
         description: The message to generate
         type: string
         example: hello world
-  types:
-    out:
-      mediaType: text/plain
+      contentType:
+        title: Content Type
+        description: The content type of the message being generated
+        type: string
+        default: text/plain
   dependencies:
     - "camel:core"
     - "camel:timer"
@@ -59,4 +61,7 @@ spec:
       steps:
         - set-body:
             constant: "{{message}}"
+        - set-header:
+            name: "Content-Type"
+            constant: "{{contentType}"
         - to: kamelet:sink

Reply via email to