This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit dd14c5efc73355390704bbaead8e09c19a9d0a4c Author: Andrea Cosentino <anco...@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"