davsclaus opened a new pull request, #28364: URL: https://github.com/apache/camel/pull/28364
Fixes [CAMEL-26025](https://issues.apache.org/jira/browse/CAMEL-26025), found while adding the catalog body types (CAMEL-24961): 1. **A producer that picks its method by a header does nothing for an unknown value.** The generated `InvokeOnHeaderStrategy` returned null for a key without a method, as a void method does, so `HeaderSelectorProducer` could not tell them apart. The SPI gets `InvokeOnHeaderStrategy.NO_METHOD` (`@since 4.24`), the generator template returns it in `default:`, and `HeaderSelectorProducer` fails with `Unsupported value NOSUCH of header CamelCaffeineAction` when no strategy has the value. The parent strategy is tried only for `NO_METHOD`, so a void method no longer runs the parent's strategy too. A strategy generated by older tooling still returns null and behaves as before. The 20 generated strategies of caffeine, consul, dynamic-router, ehcache, infinispan, servicenow, spring-redis and web3j are regenerated (only the `default:` line changes). 2. **API components did not convert the body to the type of the `inBody` parameter.** The endpoint configurer knows only the shared options, so the type was null and the body was passed as it was ("argument type mismatch" for a byte[] body to a String parameter). `AbstractApiProducer` now takes the type from the method helper of the endpoint when the configurer does not know it. This applies to all 13 API components. 3. **A header named exactly as the prefix of an API component** (`CamelFhir`) failed every call with `StringIndexOutOfBoundsException`; it is now ignored. 4. **`AbstractApiConfiguration.splitResult`** is `true` by default, as documented; google-sheets is the only configuration that extends it. 5. **`BodyFacts.kindOf`** checks for a Map before an Iterable, so a Map that is also Iterable (such as a solr `SimpleOrderedMap`) is data, as `BodyFacts.describe` calls it. The error message of `ApiMethodHelper` is not touched (that is #28310). The regenerated spring-redis strategy overlaps #28359: the second to merge regenerates it. ## Upgrade guide 4.24 gets sections for the header-selected producers (the new failure and the SPI constant), the API components inBody conversion and prefix header, and the google-sheets splitResult default. ## Tests New tests in camel-core (`HeaderSelectorProducerTest`, `AbstractApiProducerTest`, `AbstractApiConfigurationTest`, `ApiMethodPropertiesHelperTest`, `BodyFactsTest`), caffeine (`testUnknownActionFails`) and google-sheets (`GoogleSheetsConsumerSplitResultTest`); each failed before its fix. Passing: camel-support 140, camel-core 549 (the support, body type, error registry and message history tests), caffeine 86, google-sheets 39, consul 15, dynamic-router 138, ehcache 73, infinispan-embedded 99, infinispan 13, spring-redis 128, web3j 138, as2 19. _Claude Code on behalf of davsclaus_ 🤖 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]
