Claus Ibsen created CAMEL-24713:
-----------------------------------
Summary: camel-jbang - generate the camel_catalog_sample fallback
(eip-samples.json) from the user-manual YAML examples with a mojo, validated in
the build
Key: CAMEL-24713
URL: https://issues.apache.org/jira/browse/CAMEL-24713
Project: Camel
Issue Type: Improvement
Components: camel-jbang
Reporter: Claus Ibsen
camel_catalog_sample (CAMEL-24693, PR 26377) returns the YAML examples of an
EIP or file entry. For the EIP pages it reads them from the catalog's own
documentation at lookup time, so they follow the Camel version in use, and
EipDocExamplesTest (PR 26375) keeps them valid in the build. For the pages the
catalog does not bundle (the user-manual pages: routes, rest, beans,
routeTemplate, routeConfiguration, onException as a file entry, ...) the tool
falls back to eip-samples.json in camel-jbang-core, which was extracted from
the docs by hand.
Generate that file in the build instead:
* a mojo in camel-package-maven-plugin or camel-jbang's own build, bound in
camel-jbang-core (after camel-yaml-dsl and camel-yaml-dsl-validator in the
reactor, so the validator is available; camel-package-maven-plugin is built
before them and cannot validate)
* input: the [source,yaml] blocks that start with "- " of the user-manual pages
under docs/user-manual/modules/ROOT/pages (the page list configured in the pom,
or every page)
* each block validated with YamlValidator; a block that fails validation fails
the build, as EipDocExamplesTest does for the EIP pages
* output:
src/generated/resources/org/apache/camel/dsl/jbang/core/commands/ai/eip-samples.json,
keyed by the entry name with the source page, in the same shape as today
* the hand-written entries that have no documentation page (if any remain) move
to the docs first, so the file is entirely generated
Agreed with Claus on 2026-09-13 ("we can do the mojo afterwards"); until then
the shipped file stays hand-extracted.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)