gnodet-bot commented on code in PR #26488:
URL: https://github.com/apache/camel/pull/26488#discussion_r4022963847
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/CatalogLoader.java:
##########
@@ -240,6 +243,51 @@ public static CamelCatalog loadQuarkusCatalog(MavenGav
quarkusCamelBom, Function
return answer;
}
+ /**
+ * The YAML DSL JSON schema of a Camel version, read from the {@code
org.apache.camel:camel-yaml-dsl} jar of that
+ * version (every 4.x release ships {@code schema/camelYamlDsl.json}; the
canonical schema exists from 4.22).
+ *
+ * @param repos extra Maven repositories, comma separated; null for
the defaults
+ * @param version the Camel version
+ * @param canonical whether to read the canonical schema
+ * @param download whether to download when the jar is not in the
local repository
+ * @return the schema document as JSON, or null when the
version is the one of the CLI, whose schema is
+ * on the classpath
+ * @throws IOException when the jar cannot be downloaded or has no such
schema
Review Comment:
**`@throws IOException` doesn't match the method signature.**
The method declares `throws Exception`, so callers are already forced to
handle `Exception` — but the Javadoc says only `IOException` can be thrown. A
reader learning the API from the Javadoc won't know that `downloader.start()`
or `downloadArtifact()` can throw arbitrary checked exceptions beyond
`IOException`.
Change to:
```suggestion
* @throws Exception when the jar cannot be downloaded or has no such
schema
```
--
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]