k-krawczyk opened a new pull request, #26398:
URL: https://github.com/apache/camel/pull/26398

   Third batch of CAMEL-24710: the component sub-pages, the language pages and 
the yaml-dsl page. 74 of their 206 YAML route examples failed the YAML 
validator with the catalog checks, and on the language pages jsonpath did too. 
Now 6 fail the catalog checks, the docs are right in all of them, and none 
fails the schema except the one example skipped below. `EipDocExamplesTest` 
validates these pages from now on.
   
   The component pages come in a separate PR opened at the same time. The two 
only share `EipDocExamplesTest`: the class javadoc is the same in both, and the 
new tests sit in different places, so they merge in either order without 
conflict (checked with `git merge-tree`).
   
   ### Commits
   
   1. **docs.** The examples, with the XML/Java tab next to them when it has 
the same bug.
   2. **camel-jbang.** The Simple check stops reporting a function whose 
language or component is not on its classpath.
   3. **camel-yaml-dsl-validator.** An indented `---` or `...` is no longer a 
document marker. The test covers these pages.
   
   ### What was wrong in the docs
   
   | Shape | Pages | Fix |
   |---|---|---|
   | `steps:` next to `from:` in a `- route:` (36 blocks) | a2a-consumer, 
aws2-s3-consumer-examples, azure-storage-blob-consumer, 
docling-async-processing, docling-batch-processing, docling-serve, 
kubernetes-summary, oauth, pqc-hybrid, pqc-key-lifecycle | moved under `from:`, 
whitespace only |
   | `beans:` as a top-level key after a route (13 blocks) | keycloak-security 
| `- beans:`, a list entry like the route |
   | a route inside a rest verb (`get: - uri: ... route: ...`), removed in 
Camel 4; the Java tab used `.route()` for it | keycloak-security | the verbs 
call `direct:` routes that apply the policy, in the Java and YAML tabs |
   | `loopDoWhile` is not a YAML step | openai-mcp | `loop` with `doWhile: 
true` |
   | `salesforce:query?...` placeholder (all tabs); the `body` language in a 
split | salesforce-rest-api | `sObjectQuery=SELECT Id, Name FROM Account`; 
`simple: "${body}"` |
   | a multicast fragment in front of routes; a consumer without steps | 
a2a-producer, a2a-consumer | wrapped in a route from `direct:ask-agents`; a 
`setBody` step |
   | one-step fragments starting with `- ` | a2a-producer, a2a-consumer, 
openai-operations, openai-providers, yaml-dsl | a `steps:` list, as on the a2a 
component page; on the yaml-dsl page a bare step map, the way that page writes 
its other fragments (`filter:`, `marshal:`) |
   | plc4x `tags` shown on a producer, it is a consumer option | yaml-dsl | the 
Map example uses `from: plc4x` |
   
   ### The two code changes
   
   **Validator: an indented `---` or `...` is text.** A document marker starts 
at column 1. `YamlValidator.extraDocument` trimmed each line, so a `...` inside 
a block scalar, such as a script whose rest is elided, was reported as a second 
YAML document. The yaml-dsl bean scripts that hit this were rewritten in 
CAMEL-24713 in the meantime, but the check was still wrong for any file. 
`testIndentedDocumentMarkerIsText` fails without the fix.
   
   **Simple check: a missing language or function factory is not reported.** 
`${jsonpath(...)}` and `${a2a:text}` failed with `No language could be found 
for: jsonpath` or `No simple-function-factory/camel-a2a service could be found 
in the classpath`. The route works when the dependency is there, and the check 
cannot know that. This is what the ticket suggested for the language pages. It 
also changes `camel validate yaml` and `camel_validate_yaml_dsl`: they no 
longer tell the user that such a function needs a dependency. If you would 
rather keep that hint as a warning, I can change it.
   
   ### Test
   
   `everyYamlExampleOfTheOtherDocumentationPagesValidates` covers every catalog 
doc page that is not an EIP, component or data format page: 217 examples. One 
example is skipped, matched by page and content. On the yaml-dsl page, `myStep` 
shows a step contributed by a custom YAML deserializer, which the schema cannot 
know.
   
   ### What is left (6), the docs are right
   
   - **a2a-consumer:** a comment after a value (`asyncTimeout: 30000  # default 
...`) is read as part of the value by the endpoint check. YAML reads it as a 
comment.
   - **salesforce-rest-api:** `approval.actionType` and the other `approval.*` 
options are the nested binding the page documents.
   - **simple-advanced (2):** `${foo}` is a custom function the example 
registers itself.
   - **yaml-dsl:** the plc4x example is a Map in `parameters`, which is the 
point of the section; the endpoint check reads its keys as options. `myStep` is 
the skipped example above.
   
   ### Verification
   
   - Measured with the ticket's method: the sub-pages went from 74 to 6 
failing, out of 184 examples (CAMEL-24713 added one), and the language pages 
from 1 to 0.
   - All 93 tests of camel-yaml-dsl-validator pass on this branch alone. The 
camel-jbang `SourceValidator*` and `CatalogSamplesTest` tests pass too, with 
the `generate-doc-samples` build step on the changed yaml-dsl page. 
`-Psourcecheck` is clean for both modules.
   - `functionOfALanguageOrComponentNotOnTheClasspathIsNotReported` fails 
without the Simple check change.
   - The 17 catalog copies are identical to the docs.
   
   _Reported by Claude Code on behalf of Karol Krawczyk_
   


-- 
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]

Reply via email to