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

   # Description
   
   [CAMEL-25752](https://issues.apache.org/jira/browse/CAMEL-25752)
   
   The rest DSL documents `skipBindingOnErrorCode` with the default value 
`false` (the `@Metadata` of `RestConfigurationDefinition`, `RestDefinition`, 
`VerbDefinition` and `RestBindingDefinition`, and from there the catalog, the 
XML and YAML DSL schemas and the docs). At runtime an option that is not set 
falls back to `org.apache.camel.spi.RestConfiguration`, which initialises it to 
`true` (`RestBindingReifier` starts from `config.isSkipBindingOnErrorCode()` 
and only overrides it when the model sets a value). camel-main 
(`camel.rest.skipBindingOnErrorCode`) and `rest-dsl-binding.adoc` already say 
`true`; only the model said `false`.
   
   Raised by Claus Ibsen in the review of #28029 as a separate issue.
   
   This PR changes the documented default to `true`, as the ticket suggests. 
**Runtime behaviour does not change**: no runtime code reads the `@Metadata` 
default, and `RestConfiguration` is untouched.
   
   Regenerated from the metadata, with the projects' generator goals:
   - camel-core-model: the 9 model JSON files of the rest package (`rest`, 
`restConfiguration`, `restBinding`, `get`, `post`, `put`, `patch`, `delete`, 
`head`).
   - camel-yaml-dsl: `ModelDeserializers`, `camelYamlDsl.json`, 
`camelYamlDsl-canonical.json`, `camelYamlDsl-model.json`.
   - camel-catalog: the 9 model JSON files, `camel-xml-io.xsd`, 
`camel-spring.xsd` and `camelYamlDsl-model.json`. These are verbatim copies; I 
built the XSDs (camel-xml-io and camel-spring-xml `package`) and copied them 
with the model files, rather than running `prepare-catalog`, which would 
download every component artifact.
   
   Every regenerated line is the default of `skipBindingOnErrorCode` (`false` → 
`true`); no other default changed. camel-main and its generated docs/configurer 
already had `true` and are unchanged.
   
   The route writers do not change for `skipBindingOnErrorCode`: since #28029 
(CAMEL-25721) they write the rest binding options whenever they are set, 
whatever their default. What users can notice is only that tools that read the 
default from the catalog or the schemas now show `true`. I added a note to the 
4.24 upgrade guide.
   
   ## Also in this PR: `apiDocs` of a rest verb (follow-up of #28029)
   
   This is outside the scope of CAMEL-25752; it is the non-blocking point from 
the review of #28029, which I said would go here because it regenerates the 
same writers.
   
   `VerbDefinition#apiDocs` (documented default `true`) is inherited too: in 
`RestOpenApiReader`, a verb whose `apiDocs` is not set takes the value of its 
rest. So a verb with `apiDocs="true"` under a rest with `apiDocs="false"` lost 
its value in a route dump, and once the dump was loaded the verb was left out 
of the OpenAPI document. Only the API docs are affected, not routing.
   
   - `ModelWriterGeneratorMojo.Property.isInheritedOption` now lists 
`org.apache.camel.model.rest.VerbDefinition#apiDocs`.
   - The XML, YAML and Java writers are regenerated: one line each, the verb's 
`apiDocs` default `"true"` → `null`. The rest's own `apiDocs` keeps its 
default, as a rest with no value is included.
   - The #28029 entry of the 4.24 upgrade guide lists `apiDocs` of a rest verb 
with the other options.
   
   Tests:
   - New `RestBindingOptionsDefaultValueTest` (camel-core-model): for 
`bindingMode`, `skipBindingOnErrorCode`, `clientRequestValidation`, 
`clientResponseValidation`, `enableCORS` and `enableNoContentResponse`, the 
`@Metadata` default on each of the four model classes must equal the 
`RestConfiguration` default. Without the fix it fails on the four 
`skipBindingOnErrorCode` fields only.
   - Dump tests for `skipBindingOnErrorCode=false`: a new 
`restSkipBindingOnErrorCode.xml` used by the existing `ModelWriterTest` XML 
round trips (also added to `ModelParserTest`'s rest files); 
`YamlModelWriterTest.testRestSkipBindingOnErrorCodeFalse`; 
`LwModelToJavaDumperTest.testDumpRestKeepsSkipBindingOnErrorCodeFalse`. They 
failed before #28029; with #28029 merged they pass on main too, and stay as 
regression tests for this option.
   - Dump tests for `apiDocs`: a new `restVerbApiDocs.xml` (a rest with 
`apiDocs="false"`, one verb without `apiDocs` and one with `apiDocs="true"`) 
used by the `ModelWriterTest` XML round trips and `ModelParserTest`; 
`YamlModelWriterTest.testRestVerbApiDocsTrueUnderRestApiDocsFalse`; 
`LwModelToJavaDumperTest.testDumpRestVerbApiDocsTrueUnderRestApiDocsFalse`. 
Negative control: with the writers generated without the `isInheritedOption` 
line (as on main), all of them fail: `ModelWriterTest` 4 failures (`testRests` 
and `testRestsWithDiff` for the new file in both namespaces, 
`rests[0].verbs[1].apiDocs ==> expected: <true> but was: <null>`), and the YAML 
and Java tests 1 failure each (the verb's `apiDocs` is missing from the dump). 
With the line they pass.
   - Run in one reactor with the plugin, so the writers come from it: 
camel-package-maven-plugin 90, camel-core-model 11, camel-xml-io 434 (2 
skipped), camel-yaml-io 191, camel-java-io 193 (1 skipped), with 0 failures 
(all tests in those modules' `maven.packaging`, `model`, `xml`, `yaml` and 
`java` packages). Before the rebase onto #28029 (the metadata and the 
catalog/schema files are unchanged by it): camel-catalog `CamelCatalog*Test` 
1096, camel-route-parser rest tests 4, camel-yaml-dsl `*Rest*` and 
`YamlCompletionTreeTest` 24, 0 failures. The formatter and import sort ran in 
the same builds.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
     (I built the affected modules and their generators, and committed every 
file they changed. I did not run the full root build.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
     This PR was prepared with Claude Code (Claude Opus 5.5). The commit 
carries a `Co-Authored-By` trailer.
   
   _Claude Code on behalf of allthingssecurity_
   
   🤖 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