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

Work on CAMEL-24748 started by Guillaume Nodet.
-----------------------------------------------
> Component metadata disagrees with what seven components accept (operation 
> enums, consumer/producer labels, options without @UriParam)
> -------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24748
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24748
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-azure, camel-google, camel-google-storage, 
> camel-grpc, camel-jt400, camel-netty-http, camel-web3j
>    Affects Versions: 4.22.0
>            Reporter: Karol Krawczyk
>            Assignee: Guillaume Nodet
>            Priority: Major
>
> While fixing the YAML examples of the component documentation in CAMEL-24710 
> (PR https://github.com/apache/camel/pull/26397), 16 examples kept failing the 
> catalog checks although they are right for the runtime: the component 
> metadata says something the component does not do. [~davsclaus] asked for a 
> ticket on these in the review of that PR. The examples were left as they are.
> *1. azure-storage-datalake: the operation enum lists 2 values, one of them 
> does not exist* (8 examples)
> {{DataLakeConfiguration.java:106}} has {{@UriParam(label = "producer", enums 
> = "listFileSystem, listFiles", ...)}} on {{DataLakeOperationsDefinition 
> operation}}. The enum has 15 values ({{listFileSystem, createFileSystem, 
> deleteFileSystem, listPaths, getFile, downloadToFile, downloadLink, 
> deleteFile, appendToFile, flushToFile, uploadFromFile, upload, 
> openQueryInputStream, createFile, deleteDirectory}}) and no {{listFiles}}. 
> The catalog therefore rejects {{createFileSystem}}, {{deleteFile}}, 
> {{uploadFromFile}} and the other operations the page documents.
> Likely fix: drop the {{enums}} attribute so the generator takes the Java 
> enum, or list its 15 values.
> *2. google-secret-manager: the operation enum lists 1 of 4 values* (3 
> examples)
> {{GoogleSecretManagerConfiguration.java:37-38}} has {{enums = 
> "createSecret"}}, while {{GoogleSecretManagerOperations}} also has 
> {{getSecretVersion}}, {{deleteSecret}} and {{listSecrets}}.
> Likely fix: the same as above.
> *3. google-storage: objectName is labelled producer, the consumer uses it* (1 
> example)
> {{GoogleCloudStorageConfiguration.java:44}} has {{@UriParam(label = 
> "producer")}} on {{objectName}}. {{GoogleCloudStorageConsumer.poll}} reads it 
> ({{GoogleCloudStorageConsumer.java:87}}) to fetch a single object, and the 
> producer reads it too ({{GoogleCloudStorageProducer.java:380}}).
> Likely fix: {{label = "common"}}.
> *4. web3j: operation is labelled producer, the consumer uses it* (1 example)
> {{Web3jConfiguration.java:30}} has {{@UriParam(label = "producer")}} on 
> {{operation}}. {{Web3jConsumer.doStart}} switches on it to choose the 
> subscription ({{Web3jConsumer.java:61}}), and the producer uses it as the 
> default operation ({{Web3jProducer.java:100}}).
> Likely fix: {{label = "common"}}.
> *5. grpc: forwardOnError and forwardOnCompleted are labelled consumer, the 
> producer uses them* (2 examples)
> {{GrpcConfiguration.java:103-107}} label both options {{consumer}}. The 
> consumer uses them ({{GrpcConsumer.java:186,194}}), and so does the producer 
> when it streams replies to a route with {{streamRepliesTo}} 
> ({{GrpcResponseRouterStreamObserver.java:63,75}}, created by 
> {{GrpcStreamObserverFactory}}). The component page shows them on a {{to}}.
> Likely fix: {{label = "common"}}.
> *6. netty-http: bootstrapConfiguration is not in the metadata* (1 example)
> {{NettyHttpComponent.java:103-104}} takes {{bootstrapConfiguration}} out of 
> the endpoint parameters ({{resolveAndRemoveReferenceParameter}}) and binds 
> its properties onto the configuration, and the page documents it 
> ({{netty-http-component.adoc}}, "bootstrapConfiguration" section). 
> {{netty-http.json}} has no such option, so the catalog calls it unknown.
> Likely fix: declare it as an endpoint option, for example a {{@UriParam}} of 
> type {{NettyServerBootstrapConfiguration}} on the endpoint or configuration, 
> so it shows in the metadata.
> *7. jt400: the documented output options have no @UriParam, the ones in the 
> metadata cannot be set in a URI*
> The page and the tests set {{fieldsLength}} and {{outputFieldsIdx}} as 
> comma-separated strings (for example {{Jt400PgmEndpointTest.java:40}}: 
> {{outputFieldsIdx=1,2&fieldsLength=10,512,255}}). They reach 
> {{Jt400Configuration.setOutputFieldsIdx(String)}} and 
> {{setFieldsLength(String)}} ({{Jt400Configuration.java:414,425}}), which have 
> no {{@UriParam}}. The metadata instead lists {{outputFieldsIdxArray}} and 
> {{outputFieldsLengthArray}} of type {{Integer[]}} 
> ({{Jt400Configuration.java:150-154}}), and the type converter does not turn a 
> string such as {{1,2}} into an {{Integer[]}}, so those two cannot be set from 
> a URI.
> Likely fix: {{@UriParam}} on the String options (and {{@UriParam}} removed, 
> or a converter added, for the array ones).
> The jt400 examples fail the catalog checks for another reason as well (the 
> {{/QSYS.LIB/...}} path is read as options), so none of the 16 examples is 
> counted here.
> Each item is small and local to its component. Once they are fixed, the 16 
> examples pass the catalog checks as they are written today.
> _Reported by Claude Code on behalf of Karol Krawczyk_



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

Reply via email to