[
https://issues.apache.org/jira/browse/CAMEL-24774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18116165#comment-18116165
]
Claus Ibsen commented on CAMEL-24774:
-------------------------------------
Merged in https://github.com/apache/camel/pull/26525 (commit c325bd9cb584):
DocExamplesXmlSchemaTest and DocExamplesJavaImportsTest in camel-catalog,
UserManualDocExamplesTest in camel-yaml-dsl-validator.
_Claude Code on behalf of davsclaus_
> docs - guard the user-manual YAML examples, the XML examples against the
> Spring XSD, and the Java imports of the examples at build time
> ---------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-24774
> URL: https://issues.apache.org/jira/browse/CAMEL-24774
> Project: Camel
> Issue Type: Improvement
> Components: build system, documentation
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.23.0
>
>
> The census behind CAMEL-24773 (the remaining documentation example kinds)
> found three classes the existing guards (EipDocExamplesTest,
> CatalogDocExamplesTest of CAMEL-24693 and CAMEL-24710) cannot see. Each is a
> mechanical check that produced real findings on the first run:# *YAML route
> blocks of the user manual*: the two guards walk {{catalog.findDocNames()}},
> the catalog pages only. The user manual has 207 route-like YAML blocks ({{-
> route:}}, {{- rest:}}, {{- routeTemplate:}}...) that were never validated;
> the first run found two wrong ones in current upgrade guides. Extend the
> guard to the {{docs/user-manual}} pages (the upgrade guides show deliberate
> "old syntax" blocks, which need the same per-page skip mechanism as
> {{EXAMPLES_SKIPPED}}).# *XML blocks against the Spring XSD*: CAMEL-24770
> parsed the {{<route>}} fragments with camel-xml-io, which ignores the
> namespace and does not check element order or required attributes. Validating
> the {{<camelContext>}} blocks and the fragments rooted at {{rest}},
> {{restConfiguration}}, {{onException}}, {{dataFormats}}, {{intercept*}},
> {{errorHandler}}, {{onCompletion}} and the data format elements against
> {{camel-spring.xsd}} found 11 blocks with the Camel 1.x namespace, 8 Camel 2
> elements or attributes, 7 malformed fragments and 6 order/required errors
> that xml-io accepted. The fragments need wrapping in a {{<camelContext
> xmlns="http://camel.apache.org/schema/spring">}} (and single-output fragments
> in a {{<route>}} with a {{<from>}}); lines that are only {{...}} are
> placeholders to strip.# *Java imports of the examples*: every {{import
> org.apache.camel.…;}} line of a Java block resolved against the classes of
> the reactor. Trivial, and the first run found 8 imports with a wrong package
> on two pages (a class that moved and a class that never was in that
> package).Bash blocks were also checked ({{camel}} subcommands against the
> {{@Command}} names and {{addSubcommand}} registrations, {{--options}} against
> the {{@Option}} names) and are all right, so no guard is needed there._Claude
> Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)