fix: deduplicate identical oneOf/anyOf groups before cartesian product#787
Merged
reuvenharrison merged 1 commit intomainfrom Feb 3, 2026
Merged
fix: deduplicate identical oneOf/anyOf groups before cartesian product#787reuvenharrison merged 1 commit intomainfrom
reuvenharrison merged 1 commit intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #787 +/- ##
==========================================
+ Coverage 89.45% 89.47% +0.02%
==========================================
Files 249 249
Lines 12409 12435 +26
==========================================
+ Hits 11100 11126 +26
Misses 862 862
Partials 447 447
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
766b680 to
447f0b9
Compare
#710) When multiple allOf subschemas reference the same oneOf/anyOf definition, the flatten operation was creating a cartesian product of all groups, even when they were identical. This resulted in duplicated oneOf items. For example, two allOf subschemas both with oneOf: [A, B] would produce 4 items [A,A], [A,B], [B,A], [B,B] instead of the expected 2 items [A, B]. This fix deduplicates equivalent oneOf/anyOf groups before calculating the cartesian product, ensuring identical groups are merged correctly. Co-Authored-By: Claude Opus 4.5 <[email protected]>
447f0b9 to
880a450
Compare
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.
Summary
resolveCombinations()that removes equivalent groups before calculating the cartesian productProblem
When multiple allOf subschemas reference the same oneOf definition, the flatten operation was creating a cartesian product of all groups, even when they were identical.
For example:
Without the fix: produces 4 items
[A,A], [A,B], [B,A], [B,B]With the fix: produces 2 items
[A, B](as expected)Test plan
TestMerge_IdenticalOneOfGroupsto verify the fixmake testpassesCloses #710
🤖 Generated with Claude Code