davsclaus opened a new pull request, #28936:
URL: https://github.com/apache/camel/pull/28936

   Fixes [CAMEL-26161](https://issues.apache.org/jira/browse/CAMEL-26161).
   
   ## What was wrong
   
   The endpoint syntax is `zendesk:methodName` and the component doc has a YAML 
example with `uri: zendesk:getTicket`.
   With a single path element, `AbstractApiComponent.createEndpoint` passes an 
empty API name. `ZendeskComponent.getApiName`
   converted `""` to `ZendeskApiName` with the type converter, which fails with
   "Enum class ZendeskApiName does not have any constant with value: " (the 
only constant is `DEFAULT("")`).
   So only `zendesk:default/getTicket` worked.
   
   ## What changed
   
   `ZendeskComponent.getApiName` returns `ZendeskApiName.DEFAULT` for an empty 
API name. Any other name still goes through
   the type converter, so `zendesk:default/getTicket` keeps working and an 
unknown name such as `zendesk:unknown/getTicket`
   still fails.
   
   The fix is in the component, not in the docs: the documented syntax 
`zendesk:methodName` is what the catalog, the endpoint
   DSL and the doc example use. Sibling single-API components handle this in 
the component too (camel-olingo2/olingo4
   always use their `DEFAULT` API name). Multi-API components such as camel-box 
and camel-twilio need the API name, so they
   are not affected.
   
   ## Tests
   
   New `ZendeskApiNameTest` runs against a local JDK `HttpServer` as the 
Zendesk server (no external service):
   - `zendesk:getTicket?inBody=id` creates the endpoint with API `DEFAULT` and 
returns the `Ticket` (failed before the fix
     with the type conversion error)
   - `zendesk:default/getTicket?inBody=id` still works
   - `zendesk:unknown/getTicket` still fails endpoint creation
   
   `mvn clean install -Psourcecheck` in `components/camel-zendesk`: 3 tests 
pass (the ITs are skipped as before, they need
   a real Zendesk account).
   
   ## Not changed
   
   - No doc, generated file or upgrade guide change: the documented syntax and 
example are now correct as they are, and
     URIs that worked before keep working.
   
   _Claude Code on behalf of Claus Ibsen (davsclaus)_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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