fix: unwrap single non-object array items in allOf#23838
Open
RomiRand wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
2 issues found across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Contributor
|
@RomiRand could you move the code to the OpenApiNormalizer? |
1a0451d to
ffaeff5
Compare
Author
@jpfinne Oh sure didn't realize, it's a big project 😅 I gave it a shot, ptal. Gotten bigger than anticipated, thought it makes sense to integrate with the existing oneOf/anyOf handling.. Lmk if a bigger diff like this should be avoided, or if renaming |
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.
Fixes #23837
This PR unwraps the entry of an
allOfcomposed schema, if it is the only (non-object) item.Summary by cubic
Normalizes
allOfby unwrapping a single non‑object sub‑schema and turning null entries intonullable, fixing array item resolution and preventing invalid inline models. Renames the rule toSIMPLIFY_ONEOF_ANYOF_ALLOFand enables it by default. Resolves #23837.allOfinOpenAPINormalizer: removenullentries by settingnullable, unwrap a single non‑object sub‑schema, skip when$refis present, and clearallOffor primitive/boolean types in OAS 3.0; also normalize arrayitemsusing the normalized schema.allOfsimplification (including single-schema enums); updated docs/configs and test options to the new rule name.Written for commit ffaeff5. Summary will update on new commits. Review in cubic