[ 
https://issues.apache.org/jira/browse/CAMEL-22062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Luis Sergio Faria Carneiro updated CAMEL-22062:
-----------------------------------------------
    Description: 
Consider the following integration code:
{code:java}
- from:
    uri: rest:get:/demo
    steps:
    - to:
        uri: "jsonata:transform.jsonata"
        parameters:
          inputType: Jackson
          outputType: Jackson
    - setBody:
        simple: "Body class is ${body.class}"
{code}
the contents of transform.jsonata are irrelevant. Let's just say it is:
{code:json}
{
    "hello": "world"
}
{code}
Start this integration using jbang with Apache Camel 4.10.4:
{code:java}
jbang -Dcamel.jbang.version=4.10.4 camel@apache/camel run transform.jsonata 
integration.yaml
{code}
Submit a GET to [http://localhost:8080/demo] and check that the result is:
{code:java}
Body class is class java.util.LinkedHashMap
{code}
which is not a Jackson class.

The same happened with Camel 4.8.x and 4.4.x.

With Camel 4.0.4 I got a different result, though:
{code:java}
Body class is class com.fasterxml.jackson.databind.node.ObjectNode
{code}
which is a Jackson class.

This was most likely caused by 
https://issues.apache.org/jira/browse/CAMEL-20298.

  was:
Consider the following integration code:
{code:java}
- from:
    uri: rest:get:/demo
    steps:
    - to:
        uri: "jsonata:transform.jsonata"
        parameters:
          inputType: Jackson
          outputType: Jackson
    - setBody:
        simple: "Body class is ${body.class}"
{code}
the contents of transform.jsonata are irrelevant. Let's just say it is:
{code:json}
{
    "hello": "world"
}
{code}
Start this integration using jbang with Apache Camel 4.10.4:
{code:java}
jbang -Dcamel.jbang.version=4.10.4 camel@apache/camel run transform.jsonata 
integration.yaml
{code}
Submit a POST to [http://localhost:8080/demo] and check that the result is:
{code:java}
Body class is class java.util.LinkedHashMap
{code}
which is not a Jackson class.

The same happened with Camel 4.8.x and 4.4.x.

With Camel 4.0.4 I got a different result, though:
{code:java}
Body class is class com.fasterxml.jackson.databind.node.ObjectNode
{code}
which is a Jackson class.

This was most likely caused by 
https://issues.apache.org/jira/browse/CAMEL-20298.


> camel-jsonata: outputType: Jackson does not output Jackson body
> ---------------------------------------------------------------
>
>                 Key: CAMEL-22062
>                 URL: https://issues.apache.org/jira/browse/CAMEL-22062
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 4.4.5, 4.8.3, 4.10.4
>            Reporter: Luis Sergio Faria Carneiro
>            Priority: Major
>
> Consider the following integration code:
> {code:java}
> - from:
>     uri: rest:get:/demo
>     steps:
>     - to:
>         uri: "jsonata:transform.jsonata"
>         parameters:
>           inputType: Jackson
>           outputType: Jackson
>     - setBody:
>         simple: "Body class is ${body.class}"
> {code}
> the contents of transform.jsonata are irrelevant. Let's just say it is:
> {code:json}
> {
>     "hello": "world"
> }
> {code}
> Start this integration using jbang with Apache Camel 4.10.4:
> {code:java}
> jbang -Dcamel.jbang.version=4.10.4 camel@apache/camel run transform.jsonata 
> integration.yaml
> {code}
> Submit a GET to [http://localhost:8080/demo] and check that the result is:
> {code:java}
> Body class is class java.util.LinkedHashMap
> {code}
> which is not a Jackson class.
> The same happened with Camel 4.8.x and 4.4.x.
> With Camel 4.0.4 I got a different result, though:
> {code:java}
> Body class is class com.fasterxml.jackson.databind.node.ObjectNode
> {code}
> which is a Jackson class.
> This was most likely caused by 
> https://issues.apache.org/jira/browse/CAMEL-20298.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to