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:26:27 UTC

[camel-kamelets] branch mask-field-261 created (now 14a5cc3)

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

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


      at 14a5cc3  Regen catalog

This branch includes the following new commits:

     new 8bff120  Mask Field Action - Actions should not marshal into JSON if the input was not JSON
     new 14a5cc3  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] 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 mask-field-261
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 14a5cc3f620cc5dccdb529194e87b166dddc03eb
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon May 10 16:25:49 2021 +0200

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

diff --git a/library/camel-kamelets-catalog/src/main/resources/kamelets/mask-field-action.kamelet.yaml b/library/camel-kamelets-catalog/src/main/resources/kamelets/mask-field-action.kamelet.yaml
index a58019d..cb3febd 100644
--- a/library/camel-kamelets-catalog/src/main/resources/kamelets/mask-field-action.kamelet.yaml
+++ b/library/camel-kamelets-catalog/src/main/resources/kamelets/mask-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: "replacement"
           constant: "{{replacement}}"
       - bean: "org.apache.camel.kamelets.utils.transform.MaskField"
-      - 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] 01/02: Mask 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 mask-field-261
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 8bff120ec9c5a13274f838a13cb9f9068a97de56
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon May 10 16:25:30 2021 +0200

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

diff --git a/mask-field-action.kamelet.yaml b/mask-field-action.kamelet.yaml
index a58019d..cb3febd 100644
--- a/mask-field-action.kamelet.yaml
+++ b/mask-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: "replacement"
           constant: "{{replacement}}"
       - bean: "org.apache.camel.kamelets.utils.transform.MaskField"
-      - 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"