-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
unevaluated* updates (and some annotation dependency cleanup) #1541
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much, much clearer. I love this improvement. I always found annoying that keywords like these were defined so much on top of annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to see this annotation dependency cleanup get done 🎉
Co-authored-by: Karen Etheridge <ether@cpan.org>
@karenetheridge please review the changes you requested. |
jsonschema-core.md
Outdated
This keyword applies its subschema to all instance elements at indices greater | ||
than the length of the `prefixItems` array in the same schema object. If |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This keyword applies its subschema to all instance elements at indices greater | |
than the length of the `prefixItems` array in the same schema object. If | |
This keyword applies its subschema to all instance elements at indices greater | |
than or equal to the length of the `prefixItems` array in the same schema object. If |
Given that json arrays are indexed from 0: If prefixItems had 3 items, then the items keyword applies to all elements at index 3 and greater, not those greater than 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json arrays are indexed from 0
JSON 8259 doesn't specify and indexing base. Seems more like a programming language thing to me.
I'll see if I can fix this so that it doesn't mention indices at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
This keyword ignores instance elements in the array, up to and including the number of items found in the
prefixItems
array in the same schema object. It then applies its subschema to all subsequent instance elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.rfc-editor.org/rfc/rfc6901.html#section-4 specifies that JSON pointer indexes are zero-based.
I don't see how we can avoid indexes because that's a necessary part of the annotation content for these keywords (and contains
contains a list of indexes, not just the number of evaluated/validated elements), and we also use array indexes in any JSON pointer in a $ref
, and in keywordLocations and absoluteKeywordLocations in error objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a very good point. I think it's important to state that we're using zero-based indexing and reference that section.
I'll work that in. Thanks for the... pointer 😏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left this in as-is (without references to indexing), but I've also added a section specifically about array indices.
jsonschema-core.md
Outdated
@@ -1784,7 +1773,8 @@ keyword's annotation causes `contains` to assume a minimum value of 1. | |||
|
|||
The value of this keyword MUST be a valid JSON Schema. | |||
|
|||
This keyword applies its subschema to array elements. | |||
This keyword applies to array instances by applying its subschema to the array's | |||
elements. | |||
|
|||
An instance is valid against `contains` if the number of elements that are valid | |||
against its subschema is with the inclusive range of the minimum and (if any) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "... is within the ...", but doesn't relate to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. Can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're commenting on a line I didn't change. Yeah, I think you're right. Will update.
@karenetheridge please review changes per your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great; thanks!
What kind of change does this PR introduce?
Updates for spec release
Issue & Discussion References
Summary
Updates the
unevaluated*
keywords and sections that reference them (e.g. "this keyword's annotation affects the behavior of this other keyword").Does this PR introduce a breaking change?