davsclaus opened a new pull request, #30346: URL: https://github.com/apache/camel/pull/30346
## Backport of #30212 Backport of #30212 (CAMEL-27052: camel-jaxb - the part class and namespace headers are used only when allowPartClassFromHeader is enabled) onto `camel-4.22.x`, for 4.22.3. JIRA: [CAMEL-27052](https://issues.apache.org/jira/browse/CAMEL-27052) **Original PR:** #30212 - CAMEL-27052: camel-jaxb - the part class and namespace headers are used only when allowPartClassFromHeader is enabled **Original author:** @davsclaus **Target branch:** `camel-4.22.x` ### Straight or adapted Adapted: a cherry-pick (`-x`) of the squash commit f8036a4c9354, with these changes for `camel-4.22.x`: - `RestBindingAdviceFactory` and `rest-dsl-binding.adoc` are left out. On `camel-4.22.x` the Rest DSL binding creates its data formats with `createDataFormat` and does not take options over from the data format configured on the CamelContext (there is no `NOT_INHERITED_OPTIONS`), so `allowPartClassFromHeader` is never inherited by the binding there, and the doc paragraph that lists such options does not exist on this branch. - `JaxbRestBindingPartClassTest` is left out: the test does not exist on `camel-4.22.x` (it belongs to the binding inheritance above). - The upgrade-guide entry is left out of this PR: the upgrade guides for all versions live on `main`, where the 4.22.3 entry goes into `camel-4x-upgrade-guide-4_22.adoc` in a separate doc PR. - The generated files (data format and model metadata, catalog, XML/YAML DSL parsers and schemas) were regenerated by building `camel-4.22.x`, not taken from `main`. The rest applies as on `main`: the new `allowPartClassFromHeader` option (default `false`) in the model, builder, reifier and `JaxbDataFormat`, the `jaxb-dataformat.adoc` section, the new `JaxbPartClassHeaderOptionTest`, and the existing tests that set the headers enabling the option (camel-jaxb, camel-jetty and camel-servlet REST tests with `dataFormatProperty("xml.out.allowPartClassFromHeader", "true")`, camel-soap `SoapUnMarshalTest`). Behaviour change on this maintenance line: routes that set `CamelJaxbPartClass` or `CamelJaxbPartNamespace` themselves must enable `allowPartClassFromHeader` (with REST binding: `xml.out.allowPartClassFromHeader` for a REST service, `xml.in.allowPartClassFromHeader` for the `rest` producer). ### Tests camel-jaxb module tests, and `SoapUnMarshalTest`, `RestJetty*Test` and `RestServlet*Test` in camel-soap, camel-jetty and camel-servlet, run on this branch with JDK 21. _Claude Code on behalf of Claus Ibsen_ 🤖 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]
