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

   The API components take the descriptions of their methods and parameters 
from the Javadoc of the SDK sources. Some SDKs have none: twilio is generated 
without Javadoc, and zendesk has little. So the catalog has no text for 457 
methods and 782 parameters:
   
   | Component | Methods without text | Parameters without text |
   |---|---|---|
   | zendesk | 268 of 288 | 408 of 416 |
   | twilio | 155 of 155 | 326 of 326 |
   | braintree | 34 of 72 | 47 of 107 |
   | google-mail | 0 | 1 |
   
   **Descriptions file.** `camel-api-component-maven-plugin` now reads an 
optional `src/main/api-descriptions.properties` (plugin parameter 
`apiDescriptionsFile`) that fills only the descriptions the Javadoc leaves 
empty, so the Javadoc still wins where it exists. The keys use the names of the 
catalog, which are the parameter names after the `substitutions` of the pom:
   
   ```properties
   account.creator = Creates an account
   account.fetcher.pathSid = The SID of the account
   # all methods of the account API
   account.*.pathSid = The SID of the account
   # all methods of all APIs
   *.pathAccountSid = The SID of the account that owns the resource
   ```
   
   The API name is the one shown in the catalog (`DEFAULT` for a component with 
one unnamed API, such as zendesk). The file's content is part of the 
generator's hash, so editing it regenerates the sources. This PR adds no 
descriptions file yet; the twilio, zendesk and braintree texts follow in later 
PRs. I tried the plugin and camel-twilio together in one reactor with a sample 
file: the method text and both kinds of parameter text reached `twilio.json`.
   
   **Header prefix.** Each parameter of an API method can also be sent as a 
header named `CamelXxx.<parameter>`, or in the camel-case form 
`CamelXxx<Parameter>` (`ApiMethodPropertiesHelper`). box, google-drive, 
google-mail and google-sheets already declare that prefix as a header. as2, 
braintree, dhis2, fhir, google-calendar, twilio and zendesk now declare it too: 
`@Metadata` on the existing `PROPERTY_PREFIX` constant, and `headersClass` on 
the endpoint. The constant values are unchanged.
   
   Tests: 
`ApiJavaSourceComponentGeneratorMojoTest.testDescriptionsFileFillsMissingJavadoc`
 checks four things:
   - a method text and a parameter text are filled from the file;
   - a key for a renamed parameter (after substitution) is used;
   - `*.parameter` works;
   - the Javadoc wins over the file.
   
   Part of CAMEL-27980.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS
   


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