Dhairya-007 opened a new pull request, #30109:
URL: https://github.com/apache/camel/pull/30109

   ## Problem
   
   The operation header names its enum by simple name only:
   
   ```java
   javaType = "WatsonDiscoveryOperations")
   public static final String OPERATION = "CamelIBMWatsonDiscoveryOperation";
   ```
   
   `WatsonDiscoveryOperations` is 
`org.apache.camel.component.ibm.watson.discovery.WatsonDiscoveryOperations`, 
the component's own enum.
   
   Because the short name does not resolve, the header loses its value list: 
the generator derives an `enum` from a resolved enum class, so the catalog 
published no accepted values for the one header that decides what the producer 
does.
   
   ```json
   "CamelIBMWatsonDiscoveryOperation": { ..., "javaType": 
"WatsonDiscoveryOperations", ... }
   ```
   
   The matching `operation` URI option has always listed all 7, because its 
field is typed. After qualifying the header's `javaType` the two agree:
   
   ```
   operation option : 7 values
   operation header : 7 values   (was none)
   ```
   
   7 operations, with names like `listCollections`, `addDocument` and 
`deleteCollection` that nobody will guess, and the header is the only way to 
vary the operation per exchange. A wrong value is not reported either - the 
conversion yields `null` and the producer falls back to the configured 
operation.
   
   Fully qualified is the convention by a wide margin across the catalog: 3692 
header `javaType` values are fully qualified or a built-in type, and 151 are 
not.
   
   ## Fix
   
   Qualify it to 
`org.apache.camel.component.ibm.watson.discovery.WatsonDiscoveryOperations`, 
the FQN the component's own sources import. The header name is untouched.
   
   Metadata only - no behaviour change. I diffed the regenerated catalog file 
against `main`: the only differences are this `javaType` and the `enum` list 
appearing beside it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to