[
https://issues.apache.org/jira/browse/CAMEL-20495?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17822551#comment-17822551
]
Rhuan Rocha commented on CAMEL-20495:
-------------------------------------
Hi [~davsclaus] ,
In my use case, it is defined by customers, that create it and define the
jsonpath. We already have some applications running with $.store.books[0] or
something like that. Thus, we want to keep the behavior inside our solution.
I tested the 'expr.setOptions(new Option[]\{Option.ALWAYS_RETURN_LIST});' as
well, but it changes the behavior for other scenarios, like '$.store.books'.
Using a list I need to add some array operation at the end. Ex.:
$.store.books.*.
I will test those scenarios with the code of the PR.
Thank you a lot!
> Allow enable/disable Split EIP split a Map out of the box
> ---------------------------------------------------------
>
> Key: CAMEL-20495
> URL: https://issues.apache.org/jira/browse/CAMEL-20495
> Project: Camel
> Issue Type: Improvement
> Components: came-core
> Reporter: Rhuan Rocha
> Priority: Major
> Fix For: 4.5.0
>
>
> We are supporting the Split EIP splitting a map out of the box from Camel
> 3.13.0 https://issues.apache.org/jira/browse/CAMEL-17101. However, it changes
> the behavior when using jsonpath, as the jsonpath always evaluates the
> message to Map.
> {code:java}
> // code placeholder
> from("direct:start")
> .split().jsonpath("$.store.books")
> .to("log:book", "mock:result"); {code}
> My suggestion is to allow enable and disable this behavior. Look at this
> example
> {code:java}
> // code placeholder
> from("direct:start")
> .split()
> .splitMapEntry(true)
> .jsonpath("$.store.books")
> .to("log:book", "mock:result"); {code}
>
> Let me know if it makes sense. If so, I can get this issue and send a PR.
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)