[ 
https://issues.apache.org/jira/browse/CAMEL-20487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17821861#comment-17821861
 ] 

Claus Ibsen commented on CAMEL-20487:
-------------------------------------

Okay so this jakarta vs javax is a cluster fuck. You would need to add many 
maven <exclude> to remove the swagger-core that are not jakarta from all kind 
of places. 

The swagger team have not released a swagger-parser that uses jakarta so it 
bring in those other JARs, and you also need to drop openapi v2 support as 
those uses the old JARs also.

> REST API generator issue with typeOut
> -------------------------------------
>
>                 Key: CAMEL-20487
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20487
>             Project: Camel
>          Issue Type: Bug
>          Components: rest
>    Affects Versions: 4.4.0
>            Reporter: Marat Gubaidullin
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.4.1, 4.5.0
>
>
> If REST method typeOut defined then /api-doc throws exception.
> How to reproduce:
> 1. rest.camel.yaml 
> {code:java}
> - restConfiguration:
>     component: platform-http
>     apiContextPath: /api-doc
>     bindingMode: json
> - rest:
>     id: rest-b339
>     get:
>       - id: get-c5d3
>         path: /account
>         to: direct:get-account
>         outType: karavan.simple.Account
>         bindingMode: json
> - route:
>     id: route-4956
>     nodePrefixId: route-7d3
>     from:
>       id: from-cad7
>       uri: direct
>       parameters:
>         name: get-account
>       steps:
>         - setBody:
>             id: setBody-0623
>             expression:
>               groovy:
>                 id: groovy-782e
>                 expression: |-
>                   def acc = new karavan.simple.Account()
>                   acc.setAccountNumber('12345')
>                   acc.setAccountName('test')
>                   return acc
>         - log:
>             id: log-bd34
>             message: ${body}
> {code}
> 2. Java Class
> {code:java}
> public class Account {
>   // Private fields for encapsulation
>   private String accountNumber;
>   private String accountName;
>   private double balance;
>   public Account() {
>   }
>   public String getAccountNumber() {
>     return accountNumber;
>   }
>   public void setAccountNumber(String accountNumber) {
>     this.accountNumber = accountNumber;
>   }
>   public String getAccountName() {
>     return accountName;
>   }
>   public void setAccountName(String accountName) {
>     this.accountName = accountName;
>   }
>   public double getBalance() {
>     return balance;
>   }
>   public void setBalance(double balance) {
>     this.balance = balance;
>   }
> }
> {code}
> 3. Run 
> {code:java}
> jbang "-Dcamel.jbang.version=4.4.0" camel@apache/camel run * 
> --gav=karavan:simple:1
> {code}
> 4. Call /api-doc 
> {code:java}
> curl --location 'localhost:8080/api-doc'
> {code}
> 5. Get exception:
> {code:java}
> 2024-02-27 12:46:29.336  WARN 52151 --- [worker-thread-0] 
> agger.v3.core.jackson.ModelResolver : jackson 
> BeanDescription.findJsonValueAccessor not found, this could lead to 
> inaccurate result, please update jackson to 2.9+
> 2024-02-27 12:46:29.337  WARN 52151 --- [ntloop-thread-0] 
> ttp.vertx.VertxPlatformHttpConsumer : Failed handling platform-http endpoint 
> /api-doc. Caused by: [java.lang.NoClassDefFoundError - 
> javax/xml/bind/annotation/XmlElement]
> java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
>         at 
> io.swagger.v3.core.jackson.SwaggerAnnotationIntrospector.hasRequiredMarker(SwaggerAnnotationIntrospector.java:29)
>  ~[swagger-core-2.2.19.jar:2.2.19]
> {code}



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

Reply via email to