You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/05/10 14:36:57 UTC

[camel-kamelets] branch insert-field-261 created (now 4b74bae)

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

acosentino pushed a change to branch insert-field-261
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git.


      at 4b74bae  Regen catalog

This branch includes the following new commits:

     new 47d0cb2  Insert field action - Actions should not marshal into JSON if the input was not JSON
     new 4b74bae  Regen catalog

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[camel-kamelets] 01/02: Insert field action - Actions should not marshal into JSON if the input was not JSON

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch insert-field-261
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 47d0cb2365f06eaf8d7b5d67905c20fda1aa5362
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon May 10 16:36:08 2021 +0200

    Insert field action - Actions should not marshal into JSON if the input was not JSON
---
 insert-field-action.kamelet.yaml | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/insert-field-action.kamelet.yaml b/insert-field-action.kamelet.yaml
index aaf1497..f0b6cca 100644
--- a/insert-field-action.kamelet.yaml
+++ b/insert-field-action.kamelet.yaml
@@ -38,6 +38,9 @@ spec:
           when:
           - simple: "${header[Content-Type]} == 'application/json'"
             steps:
+            - set-property:
+                name: deserialized
+                constant: "true"
             - unmarshal:
                 json: 
                   library: Jackson
@@ -49,10 +52,14 @@ spec:
           name: "value"
           constant: "{{value}}"
       - bean: "org.apache.camel.kamelets.utils.transform.InsertField"
-      - marshal:
-          json: 
-            library: Jackson
-            unmarshalTypeName: com.fasterxml.jackson.databind.JsonNode
-      - set-header:
-          name: "Content-Type"
-          constant: "application/json"
+      - choice:
+          when:
+          - simple: "${exchangeProperty[deserialized]} == 'true'"
+            steps:
+            - marshal:
+                json: 
+                  library: Jackson
+                  unmarshalTypeName: com.fasterxml.jackson.databind.JsonNode
+            - set-header:
+                name: "Content-Type"
+                constant: "application/json"

[camel-kamelets] 02/02: Regen catalog

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch insert-field-261
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 4b74bae64c429616d85d6bbfa1d644544056e48f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon May 10 16:36:32 2021 +0200

    Regen catalog
---
 .../kamelets/insert-field-action.kamelet.yaml       | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/library/camel-kamelets-catalog/src/main/resources/kamelets/insert-field-action.kamelet.yaml b/library/camel-kamelets-catalog/src/main/resources/kamelets/insert-field-action.kamelet.yaml
index aaf1497..f0b6cca 100644
--- a/library/camel-kamelets-catalog/src/main/resources/kamelets/insert-field-action.kamelet.yaml
+++ b/library/camel-kamelets-catalog/src/main/resources/kamelets/insert-field-action.kamelet.yaml
@@ -38,6 +38,9 @@ spec:
           when:
           - simple: "${header[Content-Type]} == 'application/json'"
             steps:
+            - set-property:
+                name: deserialized
+                constant: "true"
             - unmarshal:
                 json: 
                   library: Jackson
@@ -49,10 +52,14 @@ spec:
           name: "value"
           constant: "{{value}}"
       - bean: "org.apache.camel.kamelets.utils.transform.InsertField"
-      - marshal:
-          json: 
-            library: Jackson
-            unmarshalTypeName: com.fasterxml.jackson.databind.JsonNode
-      - set-header:
-          name: "Content-Type"
-          constant: "application/json"
+      - choice:
+          when:
+          - simple: "${exchangeProperty[deserialized]} == 'true'"
+            steps:
+            - marshal:
+                json: 
+                  library: Jackson
+                  unmarshalTypeName: com.fasterxml.jackson.databind.JsonNode
+            - set-header:
+                name: "Content-Type"
+                constant: "application/json"