Claus Ibsen created CAMEL-27306:
-----------------------------------

             Summary: camel-jolt - a Jackson JsonNode body gives a null result, 
with no error
                 Key: CAMEL-27306
                 URL: https://issues.apache.org/jira/browse/CAMEL-27306
             Project: Camel
          Issue Type: Improvement
          Components: camel-jolt
            Reporter: Claus Ibsen
             Fix For: 4.24.0


With the default {{inputType}} ({{Hydrated}}), {{JoltEndpoint.hydratedInput}} 
parses JSON text, bytes, a stream or a file, and uses any other body as it is. 
A Jackson {{JsonNode}} body (Jackson 2 
{{com.fasterxml.jackson.databind.JsonNode}} or Jackson 3 
{{tools.jackson.databind.JsonNode}}), such as the body that {{unmarshal: json}} 
or the {{application-x-struct}} data type gives, therefore reaches the Jolt 
transform as an object Jolt does not know. Jolt only works on {{Map}} and 
{{List}} trees, so the spec matches nothing and the body becomes {{null}}. 
Nothing is logged and the exchange does not fail.

Found with the {{jolt-transformation-action}} Kamelet after 
{{json-deserialize-action}} (apache/camel-kamelets#3310, which documents 
putting {{json-serialize-action}} first as a workaround).

Expected: with {{Hydrated}}, a {{JsonNode}} body is converted to the {{Map}} / 
{{List}} tree Jolt needs (for example with the type converters of camel-jackson 
/ camel-jackson3, or by writing it as JSON and parsing that with 
{{JsonUtils}}), so the transform works on it as on the same JSON given as text.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to