davsclaus opened a new pull request, #28417:
URL: https://github.com/apache/camel/pull/28417
_Claude Code on behalf of davsclaus_
This group adds the catalog body types (CAMEL-24961) for fifteen components:
smb, stax, fop, flatpack, dfdl, mapstruct, atom, rss, oaipmh, jcr, jt400,
robotframework, citrus, spring-event and weather. Each change is an
`@BodyTypes` annotation on the Endpoint, plus the JSON it generates and the
catalog copy. Four doc pages had their body text corrected. With this group and
the other open groups, every component in the catalog has body types.
**What the catalog says now**
| Component | Consumer | Producer input | Producer output |
|---|---|---|---|
| smb | as ftp and sftp: an `SmbFile` with the content; a stream with
streamDownload; no body with download=false | text, bytes, a stream or a file |
unchanged |
| stax | | the XML as text, a stream, a file or a `Source` | the
ContentHandler after the parse |
| fop | | the XSL-FO as text, bytes, a stream or a file | a
`ByteArrayOutputStream` of the PDF or PS |
| flatpack | a `net.sf.flatpack.DataSet`, at the current row with splitRows
| the flat text, as text, bytes, a stream or the file of a file consumer |
unchanged: the rows go to the consumer of the same endpoint |
| dfdl | | text, bytes, a stream or a file; also a DOM or a Source for
UNPARSE | a DOM `Document`; a `ByteArrayOutputStream` for UNPARSE |
| mapstruct | | a type a mapper maps to className | the className object, or
null |
| atom | an `Item` per entry; a List of them with splitEntries=false | | |
| rss | a `SyndFeed` holding the one entry; the whole feed with
splitEntries=false | | |
| oaipmh | one XML text per response page | `any`: the options and headers
make the request | a List of the XML text of each page |
| jcr | a List of `javax.jcr.observation.Event` | `any`: insert stores the
headers; getById takes the id as text | the id of the node as text for insert;
unchanged for getById |
| jt400 | the text of a queue entry (bytes with format=binary) | converted
to text or bytes for a queue; an `Object[]` for a program call | unchanged; an
`Object[]` for a program call |
| robotframework | no body: the return code is a header | `any`, converted
to text for `${body}` | unchanged |
| citrus | | text or a stream; another body is compared by its toString |
unchanged; the simulated response as text for receive |
| spring-event | the `ApplicationEvent` | `any`: an ApplicationEvent as is,
else wrapped in a `CamelEvent` | unchanged |
| weather | the JSON as text (XML or HTML by mode) | `any` | the JSON as
text; unchanged with headerName |
**Checked at runtime.** Throwaway tests, not part of the PR, sent text,
bytes, a stream, a file, a Map, a POJO and no body. The setups:
- **Containers:** the samba container.
- **In memory:** a Jackrabbit repository for jcr.
- **Local files and fakes:** the feed files of the module tests, a mock
OAI-PMH server, and a fake HTTP client for weather.
- **In-process:** stax, fop, flatpack, dfdl, mapstruct, robotframework,
citrus, and a Spring context for spring-event.
Not run: the jt400 queues and the output of a program call, which need a
real IBM i (only the parameter handling was run).
**Doc fixes**
- **atom:** the body is an `Item` or a List of them, not the old Abdera
`Entry`.
- **rss:** with splitEntries=false the body is the whole `SyndFeed`, not a
List of entries.
- **flatpack:** the body is a `DataSet`, not a `DataSetList`. The claim that
it can always be read as a List is removed, and the page warns to convert it to
a Map before an async step.
- **mapstruct:** with mandatory=false, a body that no mapper converts
becomes null, not unchanged.
**Test change:** `CatalogDocTest` of camel-jbang-core used weather as its
component without body types. It now uses the split EIP, as the catalog has no
body types for EIPs. PR #28416 makes the same change in `CatalogDocsTest` for
ldif.
PRs #28373 (camel-smb), #28355 (camel-flatpack) and the others that change
these modules do not touch their Endpoint classes or generated files.
**Bugs found, not fixed here.** The JIRAs, one per component, will follow.
- **flatpack:**
- An exception in the consumer route is lost, as the rows run on a copy of
the exchange.
- With splitRows, every row shares one DataSet cursor. Reading the body as
a List in the route delivers only the first row, and a hand-off to seda fails
on every row.
- A `java.io.File` or Path body fails.
- **robotframework:**
- The consumer can never deliver, because every poll fails on its null
body.
- The producer fails on a null body, or on any null header, so the header
examples of the page fail.
- **spring-event:** the name of the endpoint is ignored. A consumer on
`spring-event:bar` got the event sent to `spring-event:foo`, and every consumer
gets all the events of the Spring context.
- **citrus:**
- A byte[] body is compared as `[123, 34, …]`, and a File as its path.
- A stream without stream caching is used up.
- **oaipmh:** the OnlyFirst header is copied onto the shared endpoint, so
one exchange with it makes all later ones return one page.
- **weather:** the location `current` writes the latitude and longitude into
the shared configuration, so every later query uses them.
- **fop, dfdl:** a null or Map body fails with a NullPointerException
instead of a clear error.
- **stax:** a byte[], Path or DOM Document body fails.
- **jt400:**
- A program call without outputFieldsIdx fails with a NullPointerException.
- A List body fails with a raw ClassCastException.
- **jcr:** insert uses `getOut()`, so all the headers are lost.
- **rss:** when the copy of the feed fails, the split consumer sends a null
body.
**Local checks**
- The changed modules build, with no change to the generated files after the
build.
- The catalog copies equal their modules.
- camel-catalog, camel-yaml-dsl-validator and camel-jbang-core tests pass.
- The Endpoint and Component DSLs regenerate with no change.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]