Skip to content

[7/7] add multi-element oneOf/anyOf/allOf tests#10

Merged
sunshowers merged 4 commits intomainfrom
sunshowers/spr/77-add-multi-element-oneofanyofallof-tests
Feb 2, 2026
Merged

[7/7] add multi-element oneOf/anyOf/allOf tests#10
sunshowers merged 4 commits intomainfrom
sunshowers/spr/77-add-multi-element-oneofanyofallof-tests

Conversation

@sunshowers
Copy link
Copy Markdown
Contributor

Add /anyof and /allof endpoints and tests for multi-element composite schema changes. Simplify compare_schema_type_all_of to use equality check like anyOf. Fix bug where boolean schema changes reported as "integer schema changed".

Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
Copy link
Copy Markdown
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.

Does this PR add additional validation or just simplify the validation that was already there? (and test it)

Comment thread src/schema.rs
Ok(ret)
}

// NOTE: Single-element allOf schemas are flattened by `try_compare_flattened`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

was this something we just missed when introducing try_compare_flattened?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah.

Comment thread src/schema.rs
self.schema_push_change(
dry_run,
"integer schema changed",
"boolean schema changed",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

untested?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a test for this.

@sunshowers
Copy link
Copy Markdown
Contributor Author

Does this PR add additional validation or just simplify the validation that was already there? (and test it)

Just simplifies existing validation. Though there's one case that is now handled better: allOf with multiple schemas where the contents on both sides are identical.

Created using spr 1.3.6-beta.1

[skip ci]
Created using spr 1.3.6-beta.1
@sunshowers sunshowers changed the base branch from sunshowers/spr/main.77-add-multi-element-oneofanyofallof-tests to main February 2, 2026 19:07
@sunshowers sunshowers merged commit 95ccda7 into main Feb 2, 2026
13 of 16 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/77-add-multi-element-oneofanyofallof-tests branch February 2, 2026 19:07
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