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

Claus Ibsen updated CAMEL-19941:
--------------------------------
    Priority: Minor  (was: Major)

> Integrate Camel with Kiota
> --------------------------
>
>                 Key: CAMEL-19941
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19941
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Federico Mariani
>            Priority: Minor
>
> [Kiota|https://learn.microsoft.com/en-us/openapi/kiota/] is a library that 
> generates Java classes from OpenAPI files. The architecture of the generated 
> classes by Kiota is interesting, and I hope it can be leveraged by Camel 
> probably by creating a new component.
> I did some experiments using Camel bean, ex.
> {code:java}
> from("timer:getById?period={{timer.period}}").routeId("getById")
>                 .bean(apiClient().posts().byPostId(5), "get()")
>                 .marshal().json(JsonLibrary.Jackson) // marshal for 
> visualization
>                 .log("getById -- ${body}");
> from("timer:post?period={{timer.period}}").routeId("post")
>                 .setBody(constant(newPost))
>                 .bean(apiClient().posts(), "post(${body})")
>                 .marshal().json(JsonLibrary.Jackson) // marshal for 
> visualization
>                 .log("post -- ${body}");
> {code}
> Kiota ApiBuilder returns a CompletableFuture, which works well with 
> _bean(..)_.
> But I think the integration can be improved since you can configure the 
> request (ex. custom additional headers), therefore, what I'd like to achieve 
> is something similar to the HTTP component, and to have something like
> {code:java}
> from("timer:post?period={{timer.period}}").routeId("post")
>                 .setHeader("CUSTOM_HEADER", simple("CUSTOM_VALUE"))
>                 .setBody(constant(...))
>                 .to("kiota??:...")
>                 .marshal().json(JsonLibrary.Jackson) // marshal for 
> visualization
>                 .log("post -- ${body}");
> {code}
> Kiota has a nice request builder, and I think users may want to use it, 
> therefore, I'd like some input here.
> * Do you think it is worth to have a component in Camel? or another sort of 
> integration with Camel
> * Do you know how this can be used with XML/YAML DSL?



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

Reply via email to