Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add annotation tests from @hyperjump/json-schema #770
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
base: main
Are you sure you want to change the base?
Add annotation tests from @hyperjump/json-schema #770
Changes from 2 commits
0aef5f8
55b9fad
3426e76
9f90e2d
2779c99
35ccff6
265103e
ec05504
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 think we can dictate an order for this, because there is no keyword execution order defined in the specification.
For example, we don't say whether applicator keywords are evaluated first before validation, or vice versa. It is up to the individual implementation to decide whether to approach schemas in a breadth-first order (leaf nodes, e.g. validation keywords, first, then descend into subschemas via applicator keywords) or depth-first (applicators first).
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 meant for this to be a convention to keep the tests consistent, not as a requirement. Test harnesses can match on these as an unordered set rather than an ordered array. However, there is an intuitive ordering that people expect when they read a schema and I'd like the tests to stay close to that expectation.
For example, here's a common example of a schema extension scenario where the user would expect their annotation to take precedence over the annotation from the extended schema.
An implementation could choose to evaluate
properties
before$ref
and the order would be["Base Foo", "Extended Foo"]
instead of the expected["Extended Foo", "Base Foo"]
. I'm just saying that I want the tests to stick to that expected order even though it's valid for it to be the other way around.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.
Both of these things should be stated explicitly.
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.
Already done commit. Let me know if the new text is sufficient.