Repository navigation
fix: restore oneOf normalization behavior of dropping parent description for single oneOf alternative - #25476
Open
Mattias-Sehlstedt wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
…ion for single oneOf alternative
Mattias-Sehlstedt
force-pushed
the
ignore-single-one-of-any-of-description-if-no-null-type-removed
branch
from
October 29, 2026 20:56
8436745 to
bd225bc
Compare
Contributor
iirc, i understood my PR as a correctness fix since descriptions should make it into the client for documentation purposes. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #23361 introduced so that a description is kept when normalizing
oneOf/anyOfschemas that only have a single "meaningful" alternative. This lead to the shapebecoming
rather than the
it became before.
This in turn changes how the alias logic handles it, because it now is considered a composite schema rather than an alias. This means that
Shapeis kept rather than dropped.This is an unintentional change in behavior, since the scope was mainly aimed at
oneOf/anyOfin the case of being a nullable wrapper.This is by no means a final and correct behavior, since the issue is much broader and tied to the separation between
siblingmanagement and de-aliasing being unclear. It is most likely a subject that has to be handled further, but this PR at least removes the unintended behavior while keeping what was requested and implemented in the previous PR that changed the behavior.It would be helpful if @timonrieger could elaborate on for what the scenario is where they want to retain the description so one could better reason about whether the normalization rules should increase their granularity.
Fixes #25467
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
Summary by cubic
Restores the pre-#23361 behavior where a
oneOf/anyOfschema with a single non-null$refalternative drops the parent description during normalization. PR #23361 kept the description in that case, which turned the collapsed$refinto a composite schema with sibling metadata and prevented the alias from being removed, so schemas likeShapewere kept instead of dropped.The parent description is now transferred only when a
nullsubtype was removed or the collapsed child is inline, keeping nullable-wrapper descriptions intact. Fixes #25467.Written for commit bd225bc. Summary will update on new commits.