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

   # Description
   
   [CAMEL-24938](https://issues.apache.org/jira/browse/CAMEL-24938)
   
   `JsonMapper.asJsonObject(BaseOptionModel)` wrote `deprecationNote` for every 
option. An option annotated with `@Metadata` gets the annotation default `""`, 
so the generated JSON had `"deprecationNote": ""` on options that are not 
deprecated. An option without `@Metadata` has null, and its entry was left out. 
So the field depended on whether the option happened to be annotated, not on 
deprecation.
   
   As proposed on the ticket (and in the review of #26762), the note is now 
written only when it is not empty. This is the convention 
`supportFileReference`, `largeInput`, `inputLanguage`, `important` and 
`endpointIdentity` already follow. `deprecated` is written as before.
   
   The rest of the diff is generated: 11979 `"deprecationNote": ""` entries are 
removed from 835 JSON files on current main. That is 5782 entries in 415 
component JSONs, 207 in the simple and file language metadata of 
`camel-core-languages`, 5989 in the 417 `camel-catalog` copies, and 1 in 
`catalog/dummy-component`. Every changed line differs only by the removed 
entry. The JSON test inputs under `src/test/resources` (tooling, jbang) are 
unchanged.
   
   How the regeneration was checked: the generated JSON files were edited with 
a script (the entry is always written inline as `"deprecationNote": "", `). 
Then every changed file was read with `JsonMapper.generateModel` and written 
again with `createParameterJsonSchema`: for 803 of the 835 files, main's 
`JsonMapper` writes main's file back byte for byte, and the patched 
`JsonMapper` writes the edited file back byte for byte. The other 32 (such as 
twilio, salesforce, http, rest and undertow, with their catalog copies) do not 
round-trip through the model, the same way with main's `JsonMapper` on main's 
files, so that is unrelated to this change; for them, as for all files, the 
real build writes each option from its annotations through the same option 
writer (an ordered map, one line per option), so the only change in its output 
is the missing entry, which is what the edit removes. The catalog copies are 
byte copies of the component files (`PrepareCatalogMojo` copies them), so they 
got 
 the same edit.
   
   Readers: `deprecationNote` reads as null for these options, as it already 
did for options without `@Metadata`. The readers in the repository (camel-jbang 
TUI, `CatalogDocs`, the YAML completion generator, 
`EndpointSchemaGeneratorMojo`) check for null or empty already. A short note 
for tooling that reads the catalog JSON is added to the 4.24 upgrade guide.
   
   Tests: new `JsonMapperTest` cases (an empty note is not written and reads 
back as null; a real note is still written). On main's `JsonMapper` the 
empty-note test fails. The full suites pass: camel-tooling-model 49 tests, 
camel-package-maven-plugin 147 tests, camel-util-json 16 and camel-tooling-util 
19.
   
   This was held until after 4.23 so the catalog of that release was not 
touched; it is rebuilt here as one commit on current main.
   
   Note: this touches many generated files, so other open PRs that regenerate 
the same component JSONs may need a rebase and a regeneration.
   
   # 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): 
[CAMEL-24938](https://issues.apache.org/jira/browse/CAMEL-24938).
   
   # 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 did not run the full root build. The generated files were edited with a 
script and checked against the patched `JsonMapper`, as described above.)
   
   # 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