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 673539660090843b2a630a4e730c2b9cbc273dc4 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon May 10 15:23:54 2021 +0200 Regen catalog --- .../kamelets/replace-field-action.kamelet.yaml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/library/camel-kamelets-catalog/src/main/resources/kamelets/replace-field-action.kamelet.yaml b/library/camel-kamelets-catalog/src/main/resources/kamelets/replace-field-action.kamelet.yaml index 61fd23e..c6f00b9 100644 --- a/library/camel-kamelets-catalog/src/main/resources/kamelets/replace-field-action.kamelet.yaml +++ b/library/camel-kamelets-catalog/src/main/resources/kamelets/replace-field-action.kamelet.yaml @@ -44,6 +44,9 @@ spec: when: - simple: "${header[Content-Type]} == 'application/json'" steps: + - set-property: + name: deserialized + constant: "true" - unmarshal: json: library: Jackson @@ -58,10 +61,14 @@ spec: name: "renames" constant: "{{renames}}" - bean: "org.apache.camel.kamelets.utils.transform.ReplaceField" - - 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"