[
https://issues.apache.org/jira/browse/CAMEL-26242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Work on CAMEL-26242 started by Andrea Cosentino.
------------------------------------------------
> camel-google-mail - the messages/attachments method fails with a
> ClassCastException, as it returns the Attachments collection and not a request
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-26242
> URL: https://issues.apache.org/jira/browse/CAMEL-26242
> Project: Camel
> Issue Type: Bug
> Components: camel-google-mail
> Reporter: Claus Ibsen
> Assignee: Andrea Cosentino
> Priority: Minor
> Fix For: 4.24.0
>
>
> Found while adding the catalog body types of google-mail and
> google-mail-stream (CAMEL-24961, PR #28403).
> h4. 1. messages/attachments fails with a ClassCastException
> The generated {{GmailUsersMessagesApiMethod}} ({{ATTACHMENTS}}, main
> 2a465aa4814c, line 25) lists {{Gmail.Users.Messages.attachments()}} as a
> method, and the catalog shows it. That accessor returns the {{Attachments}}
> sub-resource, not a request, so {{GoogleMailProducer.doInvokeMethod}} (line
> 43) fails with {{ClassCastException: ... cannot be cast to
> AbstractGoogleClientRequest}}. The same happens on the consumer
> ({{GoogleMailConsumer}}, line 41). The attachment methods themselves are
> reachable as the separate {{attachments}} API. Checked on 4.24.0-SNAPSHOT
> with a fake {{MockHttpTransport}} client set through {{clientFactory}}.
> Proposed: leave the sub-resource accessors out of the generated methods (or
> exclude them in the {{pom.xml}}), so only the methods that build a request
> are listed.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)