Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify that type must be a non-empty array #1560

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gregsdennis
Copy link
Member

What kind of change does this PR introduce?

clarification

Issue & Discussion References

Summary

Clarifies that type as an array must be non-empty.

Does this PR introduce a breaking change?

Technically yes? @awwright did point out that there is a niche use case as an alternative to {not:{}}, but the keyword certainly wasn't intended to be used this way. Also, given that we present {not:{}} as the analog to false, it's extremely unlikely that anyone will be using it this way on purpose.

Copy link
Member

@jviotti jviotti left a comment

Choose a reason for hiding this comment

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

This is great. All of these edge cases and what is technically possible can be very confusing.

@gregsdennis gregsdennis requested a review from a team November 13, 2024 00:20
@gregsdennis gregsdennis self-assigned this Nov 13, 2024
@gregsdennis gregsdennis added this to the stable-release milestone Nov 13, 2024
Copy link
Member

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

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

I'm a little reluctant to approve a breaking change without documented consensus and an ADR, but I think it's ok in this case because the support for type with an empty array was never reliable because the meta-schema has included "minItems": 1 since at least draft-04 (I didn't bother looking further back). That means that implementations that use the meta-schema to validate schemas (probably most of them) have been rejecting type with an empty array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Spec and meta-schema seem inconsistent w.r.t empty "type" array
3 participants