davsclaus opened a new pull request, #30744: URL: https://github.com/apache/camel/pull/30744
_Claude Code on behalf of davsclaus_ JIRA: [CAMEL-27452](https://issues.apache.org/jira/browse/CAMEL-27452) ## What was wrong `JavadocHelper.sanitizeDescription` removes everything between angle brackets (`<.*?>`) as if it were an HTML tag, and then drops every angle bracket that is left, because `<` and `>` are not in its list of valid characters. `EndpointSchemaGeneratorMojo` passes every option and header description through it, so placeholders, generic types and operators were lost in the component JSON, the catalog, the documentation and the endpoint and component DSL. For example the aws2-s3 grant headers said `id=`, `emailAddress=` or `uri=` with nothing after them, and the firestore query operator listed `==, , =`. ## What changed **The check.** `EndpointSchemaGeneratorMojo.validateDescriptions` runs before the descriptions are sanitized. It fails the build when a description (including its default value and deprecation notes) of a component option, endpoint option or header has angle brackets that are not part of an HTML tag. All offenders of a component are collected into one `MojoExecutionException` naming the component, the kind and name of each option, and the text that would be lost, and telling the author to write the descriptions without angle brackets. Allowed: HTML start, end and empty tags of the elements used in javadoc (`p`, `br`, `code`, `b`, `i`, `em`, `strong`, `a`, `ul`, `ol`, `li`, `pre`, `tt`, `table`, `tr`, `td`, `th` and similar), with attributes, in any case, and HTML comments. Rejected: any other text between angle brackets (`<name>`, `List<String>`, `<, >`), and a lone `<` or `>` (`> 5000`, `->`). Options that the component does not generate (a producer option of a consumer-only comp onent) are skipped. `{@code ...}` and `{@link ...}` handling is unchanged. The detection is `JavadocHelper.findRemovedAngleBracketText`, which uses the same line joining and the same regular expression as `sanitizeDescription`. **The descriptions.** A scan of all 527 component schemas on current main found 21 sources that lost text (the JIRA listed 13 modules; the scan also found camel-jms, camel-kafka, camel-jpa, camel-opa, camel-robotframework, camel-xmlsecurity, camel-file's `filterFile` and the Debezium options). They are written without angle brackets: | Component | Option or header | Before (generated) | After | |---|---|---|---| | atom | `CamelAtomFeed` | the List object | the list of `com.apptasticsoftware.rssreader.Item` objects | | aws2-ddb | `CamelAwsDdbKeySchema` | is List and not KeySchema | is a list of KeySchemaElement and not KeySchema | | aws2-s3 | `CamelAwsS3GrantFullControl`, `GrantRead`, `GrantReadACP`, `GrantWriteACP` | `id=`, `emailAddress=` or `uri=` | `id=` followed by the canonical user ID, `emailAddress=` followed by the email address, or `uri=` followed by the URI of the group | | azure-iothub | `CamelAzureIoTHubTwinProperties` | as a Map | as a java.util.Map with String keys | | event | `batchSize` | a List | a list of CamelEvent objects | | file (+ azure-files, ftp, ftps, sftp, mina-sftp, smb) | `sorter` | a java.util.Comparator class | a java.util.Comparator class that compares GenericFile objects | | file (same) | `filterFile` | `${file:size} 5000` | example changed to `${file:ext} == 'txt'` (the Simple `>` operator cannot be written without an angle bracket) | | google-firestore | `CamelGoogleFirestoreQueryOperator` | `==, , =, !=, ...` | `== (or eq), != (or ne), lt (less than), lte, gt, gte, array-contains, in, array-contains-any or not-in`, and that lt, lte, gt and gte can also be given as their symbols (matches `GoogleFirestoreProducer.applyWhereClause`) | | jms (+ activemq, activemq6, amqp) | `maxMessagesPerTask` | (eg min max) | (eg the minimum is lower than the maximum) | | jpa | `parameters` | of the generic type java.util.Map | a java.util.Map with String keys | | kafka | `batching` | as a List objects | as a list of Exchange objects | | langchain4j-agent | `mcpServer` | `mcpServer..=`, `environment.=` | `mcpServer.myServer.myProperty=myValue, where myServer is the name of the server`, `environment.myKey=myValue` | | langchain4j-embeddingstore | `returnTextContent` | returns List ... instead of List | returns a list of strings ... instead of a list of EmbeddingMatch objects | | opa | `batch` | a List parallel to the input | a list of booleans parallel to the input | | openfeature | `CamelOpenFeatureEvaluationContext` | A Map of | A java.util.Map with String keys of | | robotframework | 16 options (`tags`, `tests`, `suites`, `variables`, `listeners`, ...) | trailing `List` | Multiple values can be separated by comma. (the endpoint splits these on comma) | | sjms (+ sjms2) | `batching` | a List of the individual JMS messages | a list of Exchange objects, one for each JMS message | | smpp (+ smpps) | `CamelSmppDestAddr`, `CamelSmppId` | a List | a list of strings | | smpp (+ smpps) | `CamelSmppError` | the form Map (messageID : ...) | a map from the message ID to a list of maps, each with the destination address (CamelSmppDestAddr key) and the error code (CamelSmppError key) (matches `SmppSubmitMultiCommand`) | | smpp (+ smpps) | `CamelSmppOptionalParameter` | `String - org.jsmpp...` | `String to org.jsmpp...` | | tahu-edge | `bdSeqNumPath` | files named as -bdSeqNum | files named as the Edge Node ID followed by -bdSeqNum | | xmlsecurity-sign | `canonicalizationMethod` | `(String algorithm, List inclusiveNamespacePrefixes)` | the same, followed by "which takes a list of the inclusive namespace prefixes" | **Debezium.** The options of the six Debezium components are generated from the Debezium connector documentation (`converters`, `postProcessors`, `messageKeyColumns`, `memoryManagement*Class`, `captureTarget`, `snapshotCollectionFilterOverrides`, `publicationAutocreateMode`, `replicaIdentityAutosetValues`, the Oracle `logMiningBufferEhcache*Config` options, and `errorsMaxRetries` / `signalEmitFailureMaxRetries`, which lost a lone `> 0`). That text has placeholders, generic types and XML elements but no HTML, so `camel-debezium-maven-plugin` now escapes its angle brackets as `<` and `>` in the generated javadoc. This keeps the text, the same way camel-jms already writes `<correlation id>` in a description, but the JSON and the DSL javadoc show the entities as text. Regenerated: the component JSON of the touched modules, 36 catalog component JSON files, the 6 Debezium configuration classes, 35 endpoint DSL and 16 component DSL builder factories. No hand-written docs changed. Only descriptions change, so there is no upgrade guide entry. ## How it was tested - `JavadocHelperTest`: 18 tests (6 new: placeholders, generic types inside HTML, operators, lone brackets, summary mode, and HTML-only text that passes). - `EndpointSchemaGeneratorMojoTest`: 40 tests (10 new: option descriptions with a placeholder, generic type, operator or lone bracket fail; header and component option offenders are both named with the lost text; a deprecation note with a placeholder fails; HTML-only descriptions pass; an option the component does not generate is skipped). The whole camel-package-maven-plugin suite passes (162 tests). - `ConnectorConfigGeneratorTest`: 7 tests (1 new: the MySQL `message.key.columns` placeholder is escaped). - Built the whole components tree offline to `process-classes` with the modified plugin: 529 modules, 527 `generate` executions, BUILD SUCCESS with the check failing on offenders. Before the description fixes the same build reported the offenders listed above and nothing else. 🤖 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]
