[
https://issues.apache.org/jira/browse/CAMEL-24748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18115899#comment-18115899
]
Claus Ibsen commented on CAMEL-24748:
-------------------------------------
Five more of the same family, found while guarding the YAML doc examples
against the catalog checks (CAMEL-24710, PR 26494). The examples are right for
the runtime; the pages are in the skip list of CatalogDocExamplesTest until the
metadata agrees.
*8. olingo2 / olingo4: the syntax is apiName/methodName, the runtime reads
methodName/resourcePath* (5 examples)
{{Olingo2Endpoint}} declares {{syntax = "olingo2:apiName/methodName"}} with
{{apiName}} a required enum of one value ({{DEFAULT}}).
{{Olingo2Component.createEndpoint}} strips an optional {{DEFAULT/}} prefix and
reads the first segment as the method name and the rest as the resource path,
so the documented {{olingo2://create/Manufacturers}} is right and the catalog
reports {{Invalid enum value 'create' for option 'apiName'}}; the per-method
option {{queryParams}} is then unknown too. Same in olingo4.
*9. xmpp: port is required in the metadata, the runtime defaults it; the host
takes a user@ prefix* (4 examples)
{{XmppEndpoint.port}} is {{@UriPath @Metadata(required = true)}}, {{syntax =
"xmpp:host:port/participant"}}. {{XmppComponent.createEndpoint}} parses the URI
with {{java.net.URI}} and tolerates no port; the page documents
{{xmpp://[login@]hostname[:port][/participant]}} and every example writes
{{xmpp://[email protected]/[email protected]}}, which the catalog reads as
{{[email protected]}} or {{port=}}.
*10. huggingface: task is an enum in the metadata, the runtime takes any name
with predictorBean* (1 example)
{{HuggingFaceConfiguration.task}} has {{enums = "TEXT_CLASSIFICATION,..."}};
{{HuggingFaceComponent.createEndpoint}} falls back to any task name when
{{predictorBean}} is set, which the page documents as
{{huggingface:custom?predictorBean=...}}.
*11. salesforce: approval.* has no @UriParam* (4 examples)
{{SalesforceEndpointConfig.approval}} ({{ApprovalRequest}}) carries no
{{@UriParam}}; the salesforce-rest-api page documents {{approval.actionType}},
{{approval.comments}}, {{approval.processDefinitionNameOrId}},
{{approval.skipEntryCriteria}} as endpoint options, bound by nested property
binding.
*12. jt400: the syntax has literal segments the catalog reads as options* (in
addition to item 7)
{{syntax = "jt400:userID:password@systemName/QSYS.LIB/objectPath.type"}}:
{{QSYS.LIB}} is a literal and {{objectPath.type}} is one option with a suffix,
so the catalog reports {{Unknown option 'QSYS.LIB'}} and {{Unknown option
'objectPath.type'}} on every example.
_Claude Code on behalf of davsclaus_
> 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)