Skip to content

fix allOf of oneOfs by introducing cartesian product#982

Open
PolyProgrammist wants to merge 3 commits intooxidecomputer:mainfrom
PolyProgrammist:allOfofOneOfs
Open

fix allOf of oneOfs by introducing cartesian product#982
PolyProgrammist wants to merge 3 commits intooxidecomputer:mainfrom
PolyProgrammist:allOfofOneOfs

Conversation

@PolyProgrammist
Copy link

A fix for #897

@PolyProgrammist
Copy link
Author

@ahl could you please review?

@PolyProgrammist
Copy link
Author

PolyProgrammist commented Feb 25, 2026

Please also see the PR #988 - with this, looks like there is no need for current PR.

Though this may be more relevant as it uses new merge logic as discussed here #176

Copy link
Collaborator

@ahl ahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems reasonable, and the improvement to the github output is encouraging.

new_variants: &[Schema],
defs: &BTreeMap<RefKey, Schema>,
) -> Vec<Schema> {
let mut result = Vec::new();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems possible for there to be literal or effective duplicates in this list.

Copy link
Author

@PolyProgrammist PolyProgrammist Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there may be oneOf: [A, B] and oneOf: [C, D]
And maybe something like oneOf[{}, {type: string}] and oneOf[{type:string}, {type:string}] where for all of them the result would be {type:string}.

Do you think comparing like that is enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants