James Netherton created CAMEL-20156:
---------------------------------------

             Summary: 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: 4.2.0, 4.0.2, 3.21.2
            Reporter: James Netherton


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