davsclaus opened a new pull request, #26444: URL: https://github.com/apache/camel/pull/26444
_Claude Code on behalf of davsclaus_ Fixes [CAMEL-24744](https://issues.apache.org/jira/browse/CAMEL-24744). Follow-up to CAMEL-24722 / CAMEL-24723: what camel-jbang generates is the starting point of a user or an AI agent, and it was still written in the compact notation those tickets deprecated, so the first `camel run` warned about a Camel-generated file. ## Changes **`camel init` templates** — `yaml.ftl` (what `camel init foo.yaml` writes; added to the ticket's scope), `integration.yaml.ftl`, `kamelet-source.yaml.ftl`, `kamelet-action.yaml.ftl`: the expression goes under `expression:`, `log` is `{message: ...}`, `to` is `{uri: ...}`. `kamelet-sink`, `init-pipe` and `rest-dsl` were already canonical. **Bundled examples** — `tui-hello-world`, `content-based-router`, `message-size/orders.camel.yaml` rewritten. The stale `message-size/message-size.camel.yaml` (a copy of `orders.camel.yaml` with a license header, not in the catalog's `files` list and not in `camel-jbang-examples`) is removed. The three rewritten files are byte-identical to apache/camel-jbang-examples#TBD. **MCP scaffold tools** — `camel_openapi_scaffold` and `camel_ai_pipeline_scaffold` emit the canonical form. Running the canonical validator over the AI pipeline scaffold also caught two pre-existing bugs that meant the generated route never loaded: `steps:` was written at the route level instead of under `from:`, and in the RAG route the split's `steps:` sat beside `split:` in the same list item rather than under it. Both fixed. **Guards** (no new dependency — both modules already depend on `camel-yaml-dsl-validator`): - `TemplateHelperTest` validates every YAML template against the canonical schema, unwrapping the Integration `spec.flows` and the Kamelet `spec.template` since the validator only reads route files. - `ExampleRoutesLoadTest` validates every bundled example. - `AiPipelineScaffoldToolsTest` / `OpenApiToolsTest` validate the generated routes and assert the `expression:` wrapper. - `DependencyUpdateTest` post-processed the `camel init` output by matching `- log: ${body}`; updated with its fixture. **Upgrade guide** — a `camel-jbang` note on the changed generated output and how to check/rewrite existing files. ## Verification - `camel-jbang-mcp`: 47 tests green. - `camel-jbang-core`: full suite, 1088 tests; the only failure is `OllamaDoctorSupportTest.detectReturnsNotRunningWhenEndpointUnreachable`, which fails because Ollama runs on my machine — unrelated. - Formatter and impsort run on both modules. ## Out of scope, noticed while running the canonical validator over apache/camel-jbang-examples - The groovy "`${...}` is simple syntax" heuristic in `YamlValidator` strips `"..."`/`'...'` but not Groovy slashy strings, so GString interpolation inside a regex literal is a false positive (`ai/financial-doc-analyzer`). - `handled: {constant: true}` gets the raw `boolean found, object expected` with no canonical hint. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
