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

Zheng Feng resolved CAMEL-20156.
--------------------------------
    Resolution: Fixed

> openapi-java: REST DSL param arrayType with allowableValues can lead to 
> NoSuchMethodException
> ---------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-20156
>                 URL: https://issues.apache.org/jira/browse/CAMEL-20156
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-openapi-java
>    Affects Versions: 3.21.2, 4.0.2, 4.2.0
>            Reporter: James Netherton
>            Assignee: Zheng Feng
>            Priority: Minor
>             Fix For: 4.3.0
>
>
> There is some logic in the openapi-java component to handle different array 
> types:
> [https://github.com/apache/camel/blob/main/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiReader.java#L498-L534]
> If you provide a set of allowable values, then you end up in method 
> convertAndSetItemsEnum:
> [https://github.com/apache/camel/blob/main/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/RestOpenApiReader.java#L705]
> The problem is that the code attempts to invoke static method valueOf. This 
> will only be present for types that are standard JDK types (Integer, Float, 
> Double etc). For types like ByteArraySchema, BinarySchema etc, no such method 
> exists hence Camel startup will fail with NoSuchMethodException.



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

Reply via email to