CAMEL-23530: Move DataWeave parser to camel-dataweave component and add auto-detection in DataSonnet - #25363
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
…euse Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Add camel-dataweave dependency to camel-datasonnet so .dwl files and inline %dw expressions are automatically transpiled to DataSonnet at route initialization time with zero configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
…structs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
3fe4062 to
3d7ebc1
Compare
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 15 tested, 25 compile-only — current: 10 all testedMaveniverse Scalpel detected 40 affected modules (current approach: 10).
|
gnodet
left a comment
There was a problem hiding this comment.
Clean extraction of the DataWeave transpiler into a reusable camel-dataweave module. The auto-detection flow in DataSonnet is well-designed — createExpression(String, Object[]) properly handles .dwl resource detection and %dw content detection before delegating, and the removal of the redundant loadResource() from the 3-arg method is correct since SingleInputTypedLanguageSupport.createExpression(String, Object[]) already handles resource loading. The module is correctly integrated into the BOM, parent POM, catalog, and component reactor. CI passes.
Two minor notes:
- The generated
dataweave.jsontitle uses "Dataweave" (lowercase 'w') while the codebase consistently uses "DataWeave" — worth aligning in the source metadata. - Some useful class-level Javadoc and inline comments explaining non-obvious test edge cases were dropped during the move from
camel-jbang-core(e.g., tokenizer edge-case coverage rationale inDataWeaveLexerTest).
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of @gnodet
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
Both review suggestions addressed in 2b47741:
|
Summary
camel-jbang-coreinto a newcomponents/camel-dataweavecomponent (org.apache.camel.component.dataweave) for broader reuse. The module is a tiny pure-JDK JAR with zero runtime dependencies.camel-dataweaveas a dependency ofcamel-datasonnetso that.dwlfiles and inline%dwexpressions are automatically transpiled to DataSonnet at route initialization time — zero configuration needed..dwl) and by content header (%dw).datasonnet-language.adocwith a new "DataWeave Support" section documenting auto-detection, examples in Java/XML/YAML, and the CLI transpiler.createExpression(String, Object[])so.dwlextension check runs before the parent class loads the resource (previously the extension check was dead code). Also logs at WARN when constructs cannot be auto-converted.Test plan
camel-dataweave: 89 tests pass (moved tests + existing)camel-datasonnet: 67 tests pass (65 existing + 2 new DataWeave auto-detect tests).dwlresource auto-detection viaresource:classpath:transform.dwl%dwexpression auto-detection🤖 Generated with Claude Code