-
-
Notifications
You must be signed in to change notification settings - Fork 215
[25] Add an "Optional Tests" section to the README #345
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,57 @@ widely used, while draft-03 is long since deprecated. | |
If you see anything missing from the current supported drafts, or incorrect | ||
on any draft still accepting bug fixes, please file an issue or submit a PR. | ||
|
||
Optional Tests | ||
-------------- | ||
|
||
Tests in the `optional/` directory test optional validation behavior. Validators | ||
only need to execute tests for implemented features. | ||
|
||
There are different sets of optional features for each draft. They are | ||
summarized below. | ||
|
||
1. Arbitrary-precision number support: JSON allows numbers of | ||
arbitrary precision.\ | ||
See: [6. Numbers](https://tools.ietf.org/html/rfc8259#section-6)\ | ||
Also see: | ||
* 2019-09: [4.2. Validation of Numeric Instances](https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.4.2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's going to be a bit of a pain in the butt to maintain this as new versions come out (since each time that happens we'll have to go find the relevant new section in that draft). But such is life I suppose, I don't have a better suggestion. |
||
* 7: [4.2. Validation of Numeric Instances](https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-4.2) | ||
* 6: [3.2. Validation of numeric instances](https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-3.2) | ||
* 4: [3.2. Validation of numeric instances](https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-3.2) | ||
* 3: No link | ||
2. Encoded content in a string: The `"contentMediaType"` property is optional.\ | ||
See: | ||
* 2019-09: [8.4. contentMediaType](https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.8.4) | ||
* 7: [8.4. contentMediaType](https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8.4) | ||
3. ECMA 262 regex quirks.\ | ||
See: | ||
* 2019-09: [6.4. Regular Expressions](https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.6.4) | ||
* 7: [4.3. Regular Expressions](https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-4.3) | ||
* 6: [3.3. Regular expressions](https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-3.3) | ||
* 4: [3.3. Regular expressions](https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-3.3) | ||
* 3: https://tools.ietf.org/html/draft-zyp-json-schema-03 (look for the term | ||
"regular expression") | ||
4. References to unknown keywords: These may optionally be processed.\ | ||
See: | ||
* 2019-09: [6.5. Extending JSON Schema](https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.6.5) | ||
Julian marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* 7: [6.4. Extending JSON Schema](https://tools.ietf.org/html/draft-handrews-json-schema-01#section-6.4) | ||
* 6: [6.4. Extending JSON Schema](https://tools.ietf.org/html/draft-wright-json-schema-01#section-6.4) | ||
* 4: [5.6. Extending JSON Schema](https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6) | ||
* 3: [5.4. additionalProperties](https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4) | ||
5. Numbers having zero-valued fractional parts are integers: In the JSON data | ||
model, there is no distinction made between integers and arbitrary numbers. | ||
Some parsers, however, may not support floating-point, or even choose to | ||
make a distinction between integers and numbers having a zero-valued | ||
fractional part.\ | ||
See: [6. Numbers](https://tools.ietf.org/html/rfc8259#section-6) | ||
6. All the defined "format" values.\ | ||
See: | ||
* 2019-09: [7. A Vocabulary for Semantic Content With "format"](https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.7) | ||
* 7: [7. Semantic Validation With "format"](https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7) | ||
* 6: [8. Semantic validation with "format"](https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8) | ||
* 4: [7. Semantic validation with "format"](https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-7) | ||
* 3: [5.23. format](https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23) | ||
|
||
Who Uses the Test Suite | ||
----------------------- | ||
|
||
|
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.
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.
Thanks! I was hoping to even say a bit about each of the files present here -- e.g. a list of each file we have, and an explanation/link to why it's optional (e.g., for
zeroTerminatedFloats.json
, it's for languages that do not have floating point types. Forformat
, it's because it being a validation keyword rather than informative is optional, etc.This way there's a short sentence about each and a list of why they're not required.
Does that make sense?
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.
Could this be put into the test data itself, either in the 'description' field or in an additional 'comment' field?
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.
Decent sounding idea to me.