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

   Second batch of CAMEL-24710: the component pages. 270 of their 1,225 YAML 
route examples failed the YAML validator (schema plus the catalog checks of 
endpoints, Simple and headers). After this change none fails the schema, and 
`EipDocExamplesTest` validates the component pages too. 44 still fail the 
catalog checks, but the docs are right in all of them (see the end).
   
   The other pages (component sub-pages, languages, yaml-dsl) come in a 
separate PR opened at the same time. The two only share `EipDocExamplesTest` 
and merge in either order without conflict (checked with `git merge-tree`).
   
   ### Commits
   
   It is easier to review commit by commit:
   
   1. **The nit from #26392.** CAMEL-24716 is named in the xmlSecurity skip 
comment, in your wording.
   2. **`steps:` under `from:`, whitespace only.** 204 examples in 65 pages 
wrote `steps:` next to `from:` in a `- route:`, which the schema rejects, and 
so does the runtime (`RouteDefinitionDeserializer` has no `steps` field). `git 
show -w` of this commit is empty.
   3. **The hand fixes and the test.** 59 examples. The Java and XML tabs next 
to a fixed YAML example get the same fix.
   
   ### What was wrong in commit 3
   
   | Shape | Pages | Fix |
   |---|---|---|
   | options that do not exist | debezium-* (1.x `databaseServerName`, 
`databaseHistoryFileFilename`, `mongodbHosts`, `mongodbName`), netty 
`workerPool`, thymeleaf `contentCache`, spring-batch `jobLauncherRef`, jt400 
`ouputFieldsIdx`, atom options on a `file:` endpoint | `topicPrefix`, 
`schemaHistoryInternalFileFilename`, `mongodbConnectionString`, `workerGroup`, 
`cacheable`, `jobLauncher`, `outputFieldsIdx`, the atom feed URI |
   | values and headers that do not exist | aws2-step-functions 
`createMachine`, aws2-kinesis `region=myregion`, 
`CamelDebeziumSourceOperation`, geocoder `CamelGeocoder*`, qdrant 
`CamelQdrantIncludePayload` | `createStateMachine`, `eu-west-1`, 
`CamelDebeziumOperation`, `CamelGeoCoder*`, `CamelQdrantWithPayload` |
   | steps and fields that do not exist | `inOnly` (jms), `poll-enrich` with 
`uri` (ai-resource), `transform: dataType` (langchain4j-embeddings, pgvector), 
the `el` language (avro), the `body` language (elasticsearch, jdbc), 
`on-exception` inside a route (kafka), a rest verb with `uri`/`route` 
(keycloak), `handled: true` as a plain value (keycloak), `marshal: {}` 
(reactive-streams) | `to` with `pattern: InOnly`, `pollEnrich` with an 
expression, `transformDataType`, Simple, `simple: "${body}"`, a top-level 
`onException`, `from: rest:get:...`, `handled: {constant: ...}`, base64 |
   | producer-only component in `from:` | aws2-athena, aws2-kinesis-firehose, 
google-secret-manager, file (`bean:`) | `from: direct:` (or `seda:`) and a 
`to:` |
   | a `from:` with options and no steps, a lone `- to:` | a2a, file, jetty, 
langchain4j-agent, mail, spring-rabbitmq | a small route; a one-step fragment 
(a2a, openai) is written as a `steps:` list |
   | typographic quotes in code | jt400, hazelcast-topic | straight quotes |
   | box `upload/inBody=fileUploadRequest` | box | 
`files/upload?inBody=content&parentFolderId=0` with `CamelBox.fileName`, the 
signature of `uploadFile` |
   
   ### Worth a second look
   
   Some fixes change what the example does, not only how it is written:
   
   - **pubnub:** the `wherenow` section is removed. `Operation` has no 
`WHERENOW`, so `valueOf` throws.
   - **zookeeper:** the `awaitCreation` section is replaced by one sentence. 
The option does not exist, and the consumer always waits for the node 
(`AnyOfOperations(Exists, ExistenceChanged)`).
   - **docling:** the "author" branch of the metadata routing is removed from 
both tabs. There is no author header or field.
   - **jooq:** the "Plain SQL" example is now a `fetch` producer, as in 
`JooqPlainSQLTest`. The consumer ignores `query` (`poll()` does 
`selectFrom(table)`).
   - **kafka:** the aggregate before the producer gets 
`completionSize`/`completionTimeout`. Without them it failed at route start in 
all three tabs.
   - **aws2-s3-vectors:** `constant:` with a YAML list does not load, and the 
producer needs numbers, so the body is `groovy: "[0.1f, 0.2f, 0.3f]"`. That 
example now needs camel-groovy.
   - **keycloak:** the route calls the policy through `from: 
rest:get:/api/documents`, as the Java tab does.
   
   ### What is left (44), the docs are right
   
   - **Header check (camel-jbang `HeaderChecks`), 7.**
     - The `name:` pattern also matches `setProperty` (aws2-sqs, hwcloud-obs) 
and cuts prefix headers at the dot (box `CamelBox.fileName`, solr 
`CamelSolrField.id`, vertx-websocket `CamelVertxWebsocket.connectionKey`).
     - openai sets a header through `additionalResponseHeader.*`.
     - crypto's `CamelDigitalSignature` has no `@Metadata`.
   - **Endpoint check (camel-jbang `EndpointChecks`), 21.**
     - JSON in a `parameters:` block scalar (ai-tool).
     - Map and dotted keys that bind at runtime (spring-ai-chat, once).
     - URIs the syntax parser misreads: xmpp `user@host/participant`, olingo 
`method/resourcePath`, and jt400 with a literal `/QSYS.LIB/...` path, whose 
`fieldsLength`/`outputFieldsIdx` also lack `@UriParam`.
     - Values the runtime accepts: fop MIME types, a metrics name without type 
(`meter` by default), a huggingface custom task with `predictorBean`.
   - **Component metadata, 16.**
     - The `@UriParam` enums of `operation` list only `listFileSystem, 
listFiles` in azure-storage-datalake and only `createSecret` in 
google-secret-manager, while the operation enums in the code have more values; 
the docs use the others.
     - The label says producer while the consumer uses the option: 
google-storage `objectName`, web3j `operation`.
     - The label says consumer while the producer uses 
`forwardOnError`/`forwardOnCompleted`: grpc.
     - netty-http `bootstrapConfiguration` is not in the metadata.
   
   I can open tickets for the checks and the metadata if you want them tracked.
   
   ### Verification
   
   - Measured with the ticket's method (schema plus the catalog checks): from 
270 to 44 failing, out of 1,220 examples. Three examples became `steps:` 
fragments, and two left with the pubnub and zookeeper sections.
   - Every changed page went through `CamelYamlParser` (the YAML DSL loader 
with stubs). The only errors are the stubs' own `Cannot auto create component`.
   - `EipDocExamplesTest` fails against the component docs on main and passes 
with this change. All 92 tests of camel-yaml-dsl-validator pass; 
`-Psourcecheck` is clean.
   - The 95 catalog copies are identical to the component 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