Do not return UnparsedObject when matching nested oneOf schema#4096
Open
ddadamhooper wants to merge 1 commit into
Open
Do not return UnparsedObject when matching nested oneOf schema#4096ddadamhooper wants to merge 1 commit into
ddadamhooper wants to merge 1 commit into
Conversation
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
ddadamhooper
marked this pull request as ready for review
July 20, 2026 17:33
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.
What does this PR do?
Removes some
UnparsedObjects that come fromoneOf.I found that #4062 was failing CI because of an underlying reason: if a
oneOfcontains a "nested"oneOf, the nested one is always marked as "parsed" even if it isn't. The outcome: anyoneOfthat itself contained a (direct) unparsedoneOfbranch was being parsed asUnparsedObject.(This seems backwards: why does an inner "faux-parsed"
oneOfbranch mean the outeroneOffails? Isn't "parsed" going to give false positives, not false negatives? No: aoneOfmust match exactly one branch; if we accidentally mark the faux-parsedoneOfbranch as parsed, then two branches are marked as parsed and the outer oneOf is therefore unmatched.)Why isn't a
oneOfmarked asunparsedwhen no branch matches? Because we try to be forward-compatible with future objects (see #944). But it turns out we've been shippingUnparsedObjectfor years. I've unit-tested a 2023 class (introduced in #1843) as part of the fix.Additional Notes
It's hard to choose where to draw the line here -- which part of a request should be marked
UnparsedObjectand which part should succeed? I didn't try to formalize it; I just focused on ensuring that some valid objects get marked as parsed where they weren't before.Review checklist
Please check relevant items below: