gnodet-bot commented on code in PR #26606:
URL: https://github.com/apache/camel/pull/26606#discussion_r4054107273
##########
tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/EndpointSchemaGeneratorMojo.java:
##########
@@ -832,6 +832,9 @@ protected ComponentModel findComponentProperties(
if (schemes != null && schemes.length > 1) {
model.setAlternativeSchemes(String.join(",", schemes));
}
+ if (!Strings.isNullOrEmpty(uriEndpoint.deprecatedSchemes())) {
+ model.setDeprecatedSchemes(uriEndpoint.deprecatedSchemes());
Review Comment:
⚠️ **Blocker:** `deprecatedSchemes` is written to every scheme model derived
from the same `@UriEndpoint` annotation, including alias schemes. Result:
`openai.json` gets `"deprecatedSchemes": "openai"` — the scheme declaring
itself deprecated in its own catalog entry.
The DSL generator is safe (the self-reference guard in
`isDeprecatedSchemeAlias` covers it), but catalog consumers reading JSON
directly will see a semantically wrong entry.
Fix: only set `deprecatedSchemes` when the current scheme is not itself
listed as deprecated:
```suggestion
if (!Strings.isNullOrEmpty(uriEndpoint.deprecatedSchemes())
&&
!Arrays.asList(uriEndpoint.deprecatedSchemes().split(",")).contains(scheme)) {
model.setDeprecatedSchemes(uriEndpoint.deprecatedSchemes());
}
```
After this fix, `llm.json` will carry `"deprecatedSchemes": "openai"` and
`openai.json` will carry none.
--
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]