Skip to content

test that array-items/prefixItems adjusts the starting position for schema-items/additionalItems #477

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

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

karenetheridge
Copy link
Member

I noticed this gap in the test coverage when implementing prefixItems for 2020-12.

@karenetheridge karenetheridge requested a review from a team April 13, 2021 04:05
@gregsdennis
Copy link
Member

gregsdennis commented Apr 13, 2021

Array items isn't a thing in 2020-12.

https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.10.3.1.2

The value of "items" MUST be a valid JSON Schema.


NVM. You use prefixItems for that. I misread.

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 just approved this and then I realized that these schemas don't pass the meta-schema. items/prefixItems has a "minItems": 1 constraint.

@karenetheridge
Copy link
Member Author

oh damn, yes.. I'll rework to preserve the spirit of the tests.

@karenetheridge
Copy link
Member Author

Also.. I wish we had a CI check that ran the schemas against their respective metaschemas :)

@karenetheridge karenetheridge force-pushed the ether/more-items-tests branch from 91c1ba3 to cd54068 Compare April 13, 2021 22:07
@karenetheridge karenetheridge changed the title test empty array-items/prefixItems + schema-items/additionalItems est that array-items/prefixItems adjusts the starting position for schema-items/additionalItems Apr 13, 2021
@karenetheridge
Copy link
Member Author

I've fixed the tests to as best match what I was going for as possible, as this scenario isn't clearly tested by the other cases: that additionalItems (or schema-items in 2020-12) does not start with the first item when array-items/prefixItems validated that first item already.

@karenetheridge karenetheridge requested review from jdesrosiers, gregsdennis and a team April 13, 2021 22:09
@karenetheridge karenetheridge changed the title est that array-items/prefixItems adjusts the starting position for schema-items/additionalItems test that array-items/prefixItems adjusts the starting position for schema-items/additionalItems Apr 13, 2021
@karenetheridge karenetheridge force-pushed the ether/more-items-tests branch from cd54068 to 4e266c3 Compare April 13, 2021 23:44
@karenetheridge
Copy link
Member Author

rebased one last time for merge

@karenetheridge karenetheridge merged commit f858c61 into master Apr 13, 2021
@karenetheridge karenetheridge deleted the ether/more-items-tests branch April 13, 2021 23:44
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.

3 participants