CAMEL-23981: Fix 12 camel-yaml-dsl bugs#24599
Conversation
…ructing JtaTransactionErrorHandlerDefinition instead of SpringTransactionErrorHandlerDefinition Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…ed resources have completed configure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…uired, deprecated, and secret Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…YAML mapping is silently ignored Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…upported ref kinds, missing sink endpoint, and empty errorHandler Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…er, source location, and resource Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…eFromDefinition, RouteConfiguration, and Kamelet deserializers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…parameters when URI has a path Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…ments at wrong depth Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…error messages contain curly braces Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…heck and make yamlFiles cache per-instance Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…redFromComposition Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…er required/deprecated/secret fix Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Tests added: - ErrorHandlerTest: springTransactionErrorHandler creates correct definition type (CAMEL-23981) - RoutesTest: from note property is parsed correctly (CAMEL-23987) - NodeAtTest: nodeAt() handles leading slash, multi-level paths, and missing segments (CAMEL-23989) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Tests added: - RouteConfigurationTest: note property is parsed (CAMEL-23987) and line number/location are set (CAMEL-23986) - KameletTest: note and description properties are parsed (CAMEL-23987) - PipeLoaderTest: unsupported ref kind throws clear error (CAMEL-23985) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
Claude Code review on behalf of @gnodet
Review: CAMEL-23981 — Fix 12 camel-yaml-dsl bugs
High-quality, well-organized PR fixing 12 genuine bugs across the YAML DSL subsystem. The fixes are correct, well-scoped, and have good test coverage for the non-trivial changes. Generated schema/deserializer files have been properly regenerated.
Summary of All 12 Fixes
| # | JIRA | Bug | Has Test? |
|---|---|---|---|
| 1 | CAMEL-23981 | springTransactionErrorHandler created wrong JtaTransactionErrorHandlerDefinition |
✅ |
| 2 | CAMEL-23982 | Bean cache cleared too early when loading multiple YAML files | ❌ (low risk) |
| 3 | CAMEL-23983 | @YamlProperty swapped withRequired/withDeprecated, withIsSecret used wrong accessor |
Schema regen |
| 4 | CAMEL-23984 | Unsupported top-level YAML mappings silently ignored | ❌ (warning log) |
| 5 | CAMEL-23985 | Pipe handling lacked validation for unsupported ref kinds, missing sink, empty errorHandler | ✅ |
| 6 | CAMEL-23986 | routeConfiguration lost line number, source location, and resource metadata |
✅ |
| 7 | CAMEL-23987 | Missing note property on from, routeConfiguration, and kamelet |
✅ (3 tests) |
| 8 | CAMEL-23988 | MultiValue endpoint parameters not flattened when URI has a path | Schema regen |
| 9 | CAMEL-23989 | nodeAt() matched later pointer segments at wrong depth |
✅ (7 tests) |
| 10 | CAMEL-23990 | MessageFormat crash when error messages contain curly braces |
❌ (defensive) |
| 11 | CAMEL-23991 | ValidateMojo ignored application.yaml only, used static for per-instance state |
❌ (straightforward) |
| 12 | CAMEL-23992 | Inverted $ref check in extractRequiredFromComposition |
Schema regen |
Finding: Two missed withIsSecret instances (CAMEL-23983)
In GenerateYamlDeserializersMojo.java, two instances of the same bug at approximately lines 912 and 951 (in the java.util.List non-String and java.util.Set non-String parametrized type branches) were missed. Both still read:
.withIsSecret(descriptor.defaultValue(name))when they should be:
.withIsSecret(descriptor.isSecret(name))These handle List<SomeObject> and Set<SomeObject> properties — less common but still incorrect. Recommend fixing for completeness since the same pattern is fixed everywhere else in the file.
Other Observations (no action needed)
-
extractRequiredFromCompositionfix (CAMEL-23992): The original invertedif (!compositionEntry.has("$ref"))was also a latent NPE — it would trycompositionEntry.get("$ref").asText()when$refwas absent. Fix is correct. -
ValidateMojo
IGNORE_FILE(CAMEL-23991): The old"application.yml"was compared againstFileUtil.onlyName()which strips extensions, so"application.yml".equals("application")was always false — the ignore never worked. Fix to"application"is correct. Thestatic→ instance field change foryamlFilesis also correct (prevents cross-module contamination in reactor builds). -
MessageFormatfix (CAMEL-23990): Usingnew MessageFormat(e.getMessage())would crash on YAML/JSON parse errors containing{/}characters. Fix tonew MessageFormat("{0}").arguments(msg)is the correct defensive pattern. -
nodeAt fix (CAMEL-23989): The 7 Spock tests provide excellent coverage of the recursive pointer matching logic.
Overall: Very well done. The two missed withIsSecret instances are the only actionable item.
|
Claude Code on behalf of davsclaus @gnodet Thanks for the thorough review! Regarding the two |
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 12 tested, 10 compile-only — current: 9 all testedMaveniverse Scalpel detected 22 affected modules (current approach: 9).
|
The CAMEL-23983 fix correctly marks param 'type' as required in the schema, but the OpenAPI REST DSL generator does not always emit this field. Skip validation for this test until CAMEL-24004 is fixed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Summary
Claude Code on behalf of davsclaus
Fixes 12 YAML DSL bugs reported by Federico Mariani (CAMEL-23981 through CAMEL-23992):
springTransactionErrorHandlerwas creatingJtaTransactionErrorHandlerDefinitioninstead ofSpringTransactionErrorHandlerDefinition@YamlPropertyflag emission swappedwithRequired/withDeprecatedandwithIsSecretused wrong accessorrouteConfigurationlost line number, source location, and resource metadatanoteproperty onfrom,routeConfiguration, andkameletdeserializersnodeAt()matched later pointer segments at wrong depth due to leading/handlingMessageFormatcrash when error messages contain curly bracesValidateMojoignoredapplication.yamlonly (notapplication.properties.yaml) and used static field for per-instance state$refcheck inextractRequiredFromCompositionTest plan
camel-yaml-dslpass (1 pre-existing failure inRestTesttracked by CAMEL-24004)camel-yaml-dsl-commonpass🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com