davsclaus opened a new pull request, #28412:
URL: https://github.com/apache/camel/pull/28412

   _Claude Code on behalf of davsclaus_
   
   This group adds the catalog body types (CAMEL-24961) for thirteen 
components: dhis2, twitter-directmessage, twitter-search, twitter-timeline, 
sap-netweaver, geocoder, xchange, web3j, splunk-hec, stitch, olingo2, olingo4 
and odata. Each change is an `@BodyTypes` annotation on the Endpoint, plus the 
JSON it generates and the catalog copy. Three doc pages had their body text 
corrected.
   
   **What the catalog says now**
   
   | Component | Consumer | Producer input | Producer output |
   |---|---|---|---|
   | dhis2 | the JSON response as a stream; an Iterator of `Dhis2Resource` for 
get/collection | the resource: a Map or a POJO as JSON, text as is | the 
response as a stream; an Iterator for collection |
   | olingo2 | one `ODataEntry` per entry of a feed, a URI per link, a value 
for a property or `$count`; a stream for uread | the `data` argument as is: a 
Map for an entry, a List of Maps for links, a List of `Olingo2BatchRequest` for 
batch | the Olingo object of the read; a Map, a String or a Long; 
`HttpStatusCodes` for update and delete; a List for batch |
   | olingo4 | one `ClientEntity` per entity; the values of a collection | a 
`ClientEntity`, or the entity as JSON text | `ClientEntity`, `ClientEntitySet`, 
the client values, a Long; `HttpStatusCode` for delete |
   | odata | | text, a Map or a List for CREATE and UPDATE | the parsed 
`JsonObject`, with the entities of READ_SET in `value`; null for a 204 |
   | twitter-directmessage | a `DirectMessage` per exchange | the text to send 
| unchanged |
   | twitter-search | a `Status` per exchange | `any`: the keywords are the 
path or a header | a List of `Status` |
   | twitter-timeline | a `Status` per exchange | the text, or a `StatusUpdate` 
| unchanged (InOnly), or the `Status` (InOut) |
   | sap-netweaver | | `any`: the request is a GET of the CamelNetWeaverCommand 
header | the JSON as a Map, or the value of its one entry (the OData `d`); text 
with jsonAsMap=false or json=false |
   | geocoder | | `any`: the address or latlng are headers or options | a 
`GeocodingResult[]` (Google), or the JSON as text (Nominatim); unchanged with 
headersOnly |
   | xchange | | `any` | by method: a `Ticker`, a typed List, the metadata 
object |
   | web3j | by observable: a hash as text, an `EthBlock.Block`, a 
`Transaction`, a `Log` | `any`: only a few operations read the body, as text | 
by operation (all 65 listed) |
   | splunk-hec | | the event: text, a value, a Map, a List or a POJO, written 
into the `event` field | unchanged |
   | stitch | | a `StitchRequestBody`, a `StitchMessage`, a Map in the batch 
shape, or a List of them | the message of the response, as text |
   
   **Checked at runtime.** Every call went to a local fake. The setups:
   - **olingo2:** the sample car service of the module, served in process.
   - **olingo4:** the WireMock replay of the module.
   - **Local HTTP servers:** dhis2, sap-netweaver, splunk-hec, stitch; web3j as 
a JSON-RPC node.
   - **WireMock:** odata.
   - **geocoder:** a Google API context and a Nominatim server URL, both 
pointing at localhost.
   - **Fakes and mocks:** a fake `Exchange` for xchange, and a Mockito Twitter 
client.
   
   The tests sent text, bytes, a stream, a file, a Map, a POJO and no body, and 
are not part of the PR.
   
   Not run:
   - the olingo4 create, update and batch successes (there is no recording for 
them);
   - the geocoder geolocation of the current address;
   - the real XChange exchanges;
   - the remaining web3j operations, typed from their signatures.
   
   **Doc fixes**
   - **geocoder:** Google gives a `GeocodingResult[]`, also for the current 
address, and Nominatim gives text. The body is kept when Google denies the 
request.
   - **stitch:** in the Map examples, `key_names` is a List; a String fails.
   - **olingo4:** the request body of an entity is a `ClientEntity` or JSON 
text, not a Map.
   
   **Bugs found, not fixed here.** The JIRAs, one per component, will follow.
   - **web3j:**
     - atBlock, fromBlock and toBlock are documented with the default "latest", 
but they are null. So ETH_GET_BALANCE without atBlock fails with a 
NullPointerException.
     - ETH_GET_TRANSACTION_RECEIPT gives an `Optional`, while the other 
ETH_GET_TRANSACTION operations unwrap theirs.
     - The default operation `transaction` makes the consumer fail.
   - **stitch:**
     - A Map with `key_names` as a String fails with a ClassCastException; both 
examples of the page did this.
     - An Integer `sequence`, as JSON and YAML give it, fails.
     - A 200 with an empty body leaves the input body.
   - **odata:**
     - Bytes are serialized as a JSON array of numbers.
     - A stream or a file fails instead of being read as JSON text.
     - No body sends an empty POST.
     - The catalog shows no default for `operation`.
   - **olingo4:** filterAlreadySeen treats any Iterable as a list, so a complex 
value becomes a List of its properties, and is empty the second time.
   - **dhis2:**
     - Bytes are sent as base64 and a File as its path, with no error.
     - A body left by an earlier step is sent as the payload of a delete.
     - The collection consumer sends one message with an Iterator, instead of 
one per resource.
   - **xchange:**
     - The endpoint option `currency=BTC` fails to convert.
     - A String body such as "BTC/USDT" is not converted.
     - A method of another service does nothing.
   - **geocoder:**
     - Nominatim with no results fails with "json string can not be null or 
empty", after setting the status to OK.
     - Two tests call the real nominatim.openstreetmap.org.
   - **sap-netweaver:**
     - The credentials are put in the request URL without encoding, so a 
password with `&` or `+` is cut or changed.
     - A URL with a query gets a second `?`.
   - **splunk-hec:** with a stream body, a cut JSON request reaches the server 
before the serializer fails.
   - **twitter:**
     - A null DM body is sent without a check.
     - timelineType=public has no consumer.
   
   **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]

Reply via email to