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

Update json-schema for :tuple for 2020-12 draft #1151

Merged
merged 1 commit into from
Dec 29, 2024

Conversation

dekelpilli
Copy link
Contributor

@dekelpilli dekelpilli commented Dec 17, 2024

The current implementation was done in 2019, before the latest JSON Schema draft (2020-12). This PR updates the generated schema to match the recommended way - https://json-schema.org/understanding-json-schema/reference/array#additionalitems

In Draft 4 - 2019-09, tuple validation was handled by an alternate form of the items keyword. When items was an array of schemas instead of a single schema, it behaved the way prefixItems behaves.

+

Before to Draft 2020-12, you would use the additionalItems keyword to constrain additional items on a tuple. It works the same as items, only the name has changed.

@ikitommi ikitommi merged commit d76cb59 into metosin:master Dec 29, 2024
13 checks passed
@ikitommi
Copy link
Member

Didn't notice tuples were a thing nowadays, thanks!

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