gitPratikSingh opened a new pull request, #30797:
URL: https://github.com/apache/camel/pull/30797
## Problem
Option and header descriptions lose any text inside `<...>` in the generated
component JSON, the catalog, the docs and the Endpoint DSL Javadoc. For
example, the aws2-s3 grant headers render as *"a grantee expression such as
id=, emailAddress= or uri=."*, with the actual values gone.
The root cause is `JavadocHelper.sanitizeDescription`, which strips every
angle-bracket span, and `EndpointSchemaGeneratorMojo.fixDoc` applying it to
every header, component option and endpoint option description.
## Fix
Following the approach taken in CAMEL-27249:
* The 18 affected descriptions in 13 modules are rewritten without angle
brackets.
* A new check, `checkDescription` in `EndpointSchemaGeneratorMojo`, fails
the build when the sanitizer would remove a `<...>` span that is not a standard
HTML tag. The failure names the option and the offending spans and explains how
to rewrite the description. The check is hooked at every annotation-attribute
read point whose text reaches `fixDoc`: header `@Metadata` (in
`addEndpointHeader`), endpoint option `@UriParam`, path `@UriPath`, the
component option `@Metadata` fallback, and both `@Metadata` returns inside
`findJavaDoc`. API option descriptions are explicitly excluded by a guarded
check, since they are overridden by `@ApiMethod` text and never sanitized.
One design note: the check sits at the annotation read points rather than
inside `fixDoc` itself. Javadoc-sourced descriptions also flow through `fixDoc`
(for example Debezium's generated config classes, which are regenerated from
Debezium's own documentation), and a hard fail in `fixDoc` would break those
builds over text that Camel does not author. The read-point placement covers
all of the Camel-authored annotation text in this issue's scope.
## Regeneration
* All 13 modules regenerated with the patched plugin; the catalog JSONs are
byte-verified.
* The 5 modules that inherit the affected endpoint classes were regenerated
as well: camel-ftp, camel-azure-files, camel-mina-sftp, camel-smb and
camel-sjms2.
* The Endpoint DSL and Component DSL builders were updated for the 6
affected options.
* A repo-wide sweep confirms no stale copy of any old description remains in
any JSON.
## Tests
* 5 new tests in `EndpointSchemaGeneratorMojoTest` with new fixtures:
rejection for a header, an endpoint option and a component option, plus HTML
acceptance for a header and an option.
* Negative control: on unmodified code the 3 rejection tests fail ("nothing
was thrown") while the 2 HTML acceptance tests and the 30 baseline tests pass.
* With the fix: `EndpointSchemaGeneratorMojoTest` passes 35/35, and the full
camel-package-maven-plugin suite passes 153/157. The 4
`CamelWebsiteContentTest` failures are a limitation of the sandbox this was
developed in (it blocks HTTP connections to 127.0.0.1, so every request times
out) and are unrelated to this change.
--
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]