davsclaus commented on code in PR #27841:
URL: https://github.com/apache/camel/pull/27841#discussion_r4294377210


##########
dsl/camel-jbang/camel-jbang-mcp/src/main/java/org/apache/camel/dsl/jbang/core/commands/mcp/ConfigurationValidateTools.java:
##########
@@ -105,16 +130,41 @@ public ConfigurationValidateResult 
camel_configuration_validate(
     }
 
     private PropertyValidationInfo toPropertyValidationInfo(
-            int lineNumber, String text, 
ConfigurationPropertiesValidationResult result) {
-        boolean valid = result.isSuccess();
-        boolean accepted = result.isAccepted();
-        int errors = result.getNumberOfErrors();
-        int warnings = result.getNumberOfWarnings();
+            int lineNumber, String text, 
ConfigurationPropertiesValidationResult result, boolean isSpringBoot) {
+        boolean checked = result.isAccepted();
+        // A checked line is valid when the catalog found no errors; an 
unchecked line
+        // (not recognised as a Camel property) is neither valid nor invalid — 
it is simply
+        // not inspected by this catalog.
+        boolean valid = checked && result.isSuccess();
+
+        // For Spring Boot, the catalog uses camel-main metadata which does 
not include
+        // starter-specific options (e.g. camel.metrics.uriTagEnabled from 
camel-micrometer-starter).
+        // When the only issues are "unknown option" errors, downgrade to 
unchecked to avoid
+        // false positives — the starter may legitimately bind options outside 
the main schema.
+        if (isSpringBoot && checked && !valid) {

Review Comment:
   This also downgrades `camel.component.*`, `camel.dataformat.*`, 
`camel.language.*` and `camel.main.*` lines. On main, 
`camel.component.kafka.brokerz=x` with `runtime=spring-boot` was `valid=false` 
with a "did you mean brokers" suggestion. Now it is `checked=false` with no 
issues. Could the downgrade apply only to the groups this PR newly accepts, and 
keep `collectIssues(result)` on downgraded lines so the suggestions are still 
returned?



##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc:
##########
@@ -13,6 +13,33 @@ See the xref:camel-upgrade-recipes-tool.adoc[documentation] 
page for details.
 
 == Upgrading Camel 4.23 to 4.24
 
+=== camel-report-maven-plugin:validate / configuration-validate
+
+The catalog now accepts all `camel.*` groups defined in 
`camel-main-configuration-metadata.json`
+(previously only 10 groups out of 36 were recognized). As a result,
+`camel-report-maven-plugin:validate` and the camel-jbang MCP 
`camel_configuration_validate` tool
+now validate approximately 26 additional `camel.*` groups (including 
`camel.server.*`,

Review Comment:
   On main, 7 of the 10 old prefixes were main groups (main, resilience4j, 
faulttolerance, threadpool, health, lra, rest). The other 3 were component, 
dataformat and language. So 29 of the 36 groups are newly checked, not about 
26. It would also help to say here that Spring Boot projects may see "Unknown 
option" for starter-only keys such as `camel.metrics.uriTagEnabled`, since 
`validate` uses the camel-main metadata.



##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc:
##########
@@ -13,6 +13,33 @@ See the xref:camel-upgrade-recipes-tool.adoc[documentation] 
page for details.
 
 == Upgrading Camel 4.23 to 4.24
 
+=== camel-report-maven-plugin:validate / configuration-validate
+
+The catalog now accepts all `camel.*` groups defined in 
`camel-main-configuration-metadata.json`
+(previously only 10 groups out of 36 were recognized). As a result,
+`camel-report-maven-plugin:validate` and the camel-jbang MCP 
`camel_configuration_validate` tool
+now validate approximately 26 additional `camel.*` groups (including 
`camel.server.*`,
+`camel.management.*`, `camel.vault.*`, `camel.ssl.*`, and others).
+
+Group names are now matched with dash- and case-insensitive normalisation, 
matching how
+camel-main binds keys at runtime. For example, `camel.error-registry.enabled` 
and
+`camel.ai-observability.enabled` are now accepted alongside their camel-case 
equivalents.
+
+If your project uses `camel-report-maven-plugin:validate` with 
`failOnError=true`,
+a key that was silently ignored before (e.g. a misspelled option under one of 
the newly accepted
+groups) may now cause the build to fail. Review the validation output and 
correct any misspelled keys.
+
+The `camel_configuration_validate` MCP tool response format has changed:
+
+* `PropertyValidationInfo.accepted` is renamed to `checked`.
+* `ConfigurationValidateSummary` gains a new `unchecked` integer field 
counting lines whose
+  namespace is not recognized as a Camel property (e.g. `server.port=8080` or 
`quarkus.*` keys).
+  Such lines had no `accepted` flag before; they are now explicitly classified 
as `checked=false`

Review Comment:
   These lines did have the flag before: the tool returned `accepted=false` and 
`valid=true` for them. Maybe: "Before, such lines were returned with 
`accepted=false` and `valid=true`; they are now `checked=false` and are left 
out of `summary.valid` and `summary.errors`."



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