davsclaus commented on PR #27079: URL: https://github.com/apache/camel/pull/27079#issuecomment-5908682857
Two more areas before this is complete: round-trip test coverage across all the DSLs, and making the new EIP discoverable by AI tooling. ### Tests: DSL parsers and round trip Already covered: core `SwitchTest`, yaml-dsl `SwitchTest` + `SwitchYamlDumpTest`, xml-io-dsl `XmlSwitchTest`, java-io `switchLiteral.xml`, and a JAXB model round trip in `SwitchJaxbTest`. Missing: - **camel-xml-io**: `ModelWriterTest.testRoutes` round-trips every routes file under `core/camel-xml-io/src/test/resources` (parse → write → parse → deep equals). Please add a `switch.xml` fixture there with a selector, a few cases (including `id`s), `switchOtherwise`, and an xpath selector with namespaces. That covers the generated `ModelParser`/`ModelWriter`. - **camel-yaml-io**: add a `yaml-route-switch.yaml` fixture with a `YamlModelWriterTest` case, like `yaml-route-choice.yaml`. Also add a Switch route to `XmlToYamlTest` and `YamlPrinterRoundTripTest`. - **camel-spring-xml**: `SwitchJaxbTest` builds the model in Java and dumps it. It never loads a route from a Spring XML file, so the `camel-spring.xsd` schema and the namespace handler are untested. Please add `processor/SpringSwitchTest` + `SpringSwitchTest.xml`, following `SpringChoiceTest`. Ideally it extends the core `SwitchTest`, like the other Spring EIP tests do. - **yaml-dsl**: also load at least one route from a `.camel.yaml` resource file through the routes loader (not only an inline string), and assert that the `camel-yaml-dsl` JSON schema accepts and rejects the expected shapes. `SwitchSchemaTest` in the validator does part of this. ### AI discoverability The generated `eip-samples.json` already picks up the doc samples, so `camel_catalog_sample` works. But nothing routes a user's words to Switch: - **Catalog aliases**: add `aliases` on `SwitchDefinition` `@Metadata` (e.g. `decision-table`, `dispatch-table`, `case`). `camel_catalog_find kind=eip` matches on these. - **`CatalogSamples.INTENTS`** (`camel-jbang-core/.../commands/ai/CatalogSamples.java`): add intents such as `route by value`, `switch case` and `decision table` → `switch`. Leave `route by content`/`if` → `choice`. Watch `lookup`, which already maps to `enrich`. - **`CatalogSamples.PART_OF`**: add `case` → `switch` and `switchOtherwise` → `switch`, so asking for a part returns the parent sample, like `when`/`otherwise` → `choice`. - **Prompt/tool text**: `PromptDefinitions` step 2 (camel-jbang-mcp) and `ToolRegistry` (the "e.g. split, aggregate, filter, choice" lists) could mention `switch`, so models know it exists when they plan a route. - **Sample content**: models copy samples closely. The first `switch-eip.adoc` sample should show the intended design, one case per `direct:` route, with the TIP about no inlined sub-routes right next to it. _Claude Code on behalf of davsclaus_ -- 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]
