[ 
https://issues.apache.org/jira/browse/CAMEL-24713?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-24713.
---------------------------------
    Resolution: Fixed

Done on main in two PRs:

* https://github.com/apache/camel/pull/26390 - the user manual YAML examples 
that did not validate (11 pages, 18 blocks) are fixed, and the YAML DSL route 
gets the delayer option the model has
* https://github.com/apache/camel/pull/26391 - the generate-doc-samples goal in 
camel-yaml-dsl-validator-maven-plugin, bound in camel-jbang-core, generates 
eip-samples.json from the EIP pages, the configured user manual pages and the 
beans examples of yaml-dsl.adoc, and fails the build when an example does not 
validate. CatalogSamples also reads the pattern pages without the -eip suffix 
from the catalog. camel_catalog_sample is documented on the MCP server page.

_Claude Code on behalf of Claus Ibsen_

> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 4.23.0
>
>
> 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)

Reply via email to