davsclaus opened a new pull request, #28023:
URL: https://github.com/apache/camel/pull/28023
Second part of CAMEL-25736: the data formats and languages whose
documentation had no YAML route example. `camel_catalog_sample` reads its
samples from the documentation, so it had nothing to give for them.
## What
- **YAML examples for 14 data formats on 12 pages:** asn1, barcode, bindy
(bindyCsv, bindyFixed, bindyKvp), crypto, fhirJson, fhirXml, flatpack, fory,
jaxb, jsonApi, mimeMultipart and parquetAvro.
- Where the page has a Java example, the YAML example is a tab next to it,
as on the other data format pages.
- The jaxb and bindy pages get a "Using the YAML DSL" section after their
Spring XML section.
- fory, jsonApi, fhirJson and fhirXml had no usage example. They get a
short Usage section.
- **YAML examples for 3 languages:** js, openfeature and python.
- js and python: a predicate in a choice, and an expression that sets the
body. They had no example at all.
- openfeature: a YAML tab next to each Java example. The section "Java
DSL" is now "Filter", as it shows a filter.
- The file language page stays without one, on purpose. `file` is also a
component. With samples for both, `camel_catalog_sample file` answers with a
choice of kind, instead of the file component samples (29, three of them with
`${file:...}`).
- **What the examples needed to say**, checked in the code:
- crypto: the key is a bean. The YAML example makes it with a Groovy
script, and the initialization vector the same way.
- parquetAvro: to marshal POJOs, `unmarshalType` is needed on marshal too,
because the schema comes from that class.
- fory: the data format registers the `unmarshalType` class, so it belongs
on marshal too.
- bindy: without `locale`, numbers follow the locale of the JVM. On a
machine with a Danish or German locale, `2500.45` is written as `2500,45` in a
comma-separated file.
- **flatpack Java examples fixed:** they used Spring's `ClassPathResource`
(`setDefinition` takes the resource name) and an undefined variable.
- **`CatalogSamples` puts the samples of the asked data format first.** The
univocity pages show the csv, fixed and tsv formats, so `univocityTsv` got the
csv and fixed samples (2 by default). bindyCsv, bindyFixed and bindyKvp share
the bindy page and are told apart by their `type`.
The catalog copies of the 15 pages are updated with them.
## Checks
- Every new example passes `camel_validate_source`.
- Run with `camel run`: the five crypto examples, the bindy examples (CSV,
fixed-length and key-value, with small model classes), fory, fhirJson and
fhirXml, barcode, mimeMultipart, and all the language examples (openfeature
with the flags file of its tests).
- Data formats with a sample of their own: 56 of 56 (42 before). Languages:
28 of 29 (25 before), all but file.
- With samples for both kinds, `crypto` and `flatpack` now answer with a
choice of component or data format, as `avro` does. They are different things,
so the model should say which one it wants.
- On a full reactor build, the tests of camel-catalog (1101),
camel-yaml-dsl-validator (240), camel-jbang-core (2503) and camel-jbang-mcp
(503) pass, `CatalogDocExamplesTest` included.
- `CatalogSamplesTest`: the bindy and univocityTsv samples come in the right
order, and the check of the answer for a page without an example no longer
depends on a page of the documentation (it was bindy).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
--
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]