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

Claus Ibsen updated CAMEL-20507:
--------------------------------
    Description: 
See this class JsonPathSplitSingleListOptionTest 
(https://github.com/apache/camel/pull/13364)

                var jsonpath = 
expression().jsonpath().option(Option.ALWAYS_RETURN_LIST.name()).expression("$.store.book[0]").end();


The option is an enum from camel-jsonpath, but the DSL method accepts only a 
String. It would be nice if we could somehow pass in just the enum field, 
without having to call .name(), ala:

                var jsonpath = 
expression().jsonpath().option(Option.ALWAYS_RETURN_LIST).expression("$.store.book[0]").end();

So we have both a String and an enum field method in the generated fluent 
builder.

  was:
See this class JsonPathSplitSingleListOptionTest

                var jsonpath = 
expression().jsonpath().option(Option.ALWAYS_RETURN_LIST.name()).expression("$.store.book[0]").end();


The option is an enum from camel-jsonpath, but the DSL method accepts only a 
String. It would be nice if we could somehow pass in just the enum field, 
without having to call .name(), ala:

                var jsonpath = 
expression().jsonpath().option(Option.ALWAYS_RETURN_LIST).expression("$.store.book[0]").end();

So we have both a String and an enum field method in the generated fluent 
builder.


> camel-core - Java fluent builder for expression can allow to use enum class 
> directly
> ------------------------------------------------------------------------------------
>
>                 Key: CAMEL-20507
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20507
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Priority: Major
>             Fix For: 4.x
>
>
> See this class JsonPathSplitSingleListOptionTest 
> (https://github.com/apache/camel/pull/13364)
>                 var jsonpath = 
> expression().jsonpath().option(Option.ALWAYS_RETURN_LIST.name()).expression("$.store.book[0]").end();
> The option is an enum from camel-jsonpath, but the DSL method accepts only a 
> String. It would be nice if we could somehow pass in just the enum field, 
> without having to call .name(), ala:
>                 var jsonpath = 
> expression().jsonpath().option(Option.ALWAYS_RETURN_LIST).expression("$.store.book[0]").end();
> So we have both a String and an enum field method in the generated fluent 
> builder.



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

Reply via email to