-
-
Notifications
You must be signed in to change notification settings - Fork 311
some edits to the spec for the interim update release #1110
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
Changes from all commits
6df9b8c
b6d3b09
7ec8df1
f78b65c
dca5361
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,6 +213,23 @@ | |
<eref target="https://json-schema.org/draft/2020-12/meta/validation"/>. | ||
</t> | ||
|
||
<section title="Keyword Independence"> | ||
<t> | ||
Schema keywords typically operate independently, without | ||
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. I think it would be better not to copy the wording from the core spec- then it will get out of sync, and I kind of like keeping the statements of principles in the core. You can xref it, and/or just note the vocabulary-specific dependencies. But this is not a hill I intend to die on so if you feel strongly feel free to keep it. 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. If the Applicator vocabulary itself has this paragraph, it's reasonable for the Validation vocabulary to have it too. How about moving it out into the general section before we start talking about individual vocabularies? Then all the exceptions don't need to be listed explicitly -- we can just give a single example, and direct the reader to pay close attention to individual keyword definitions for the exceptions. 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. Well that's embarrassing. I thought it was in the general section (don't look at the change log- it's probably my fault it's not 😅 ). If you feel like factoring it out that would be great, but I do worry a bit about not highlighting the interactions sufficiently. I would be totally fine leaving this the way you have it now (with the duplicated language) and factoring it out in the next draft. 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. I also didn't realize this wasn't in the general section. It definitely should be. There's no reason to duplicate documentation of this common principle. I can help with the refactor if needed. 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. Agreed. 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 looks like there is a section in each applicable vocabulary (applicator, validation, unevaluated), but the content is all slightly different. Is it better to have similar-but-slightly-different wording in several places, or just one wording in one place (if this is the case, I would propose putting it in section 7.10)? |
||
affecting each other's outcomes. | ||
</t> | ||
<t> | ||
For schema author convenience, there are some exceptions among the | ||
keywords in this vocabulary: | ||
<list> | ||
<t> | ||
"maxContains" and "minContains", whose behavior is affected by the | ||
presence and value of "contains", in the Applicator vocabulary | ||
</t> | ||
</list> | ||
</t> | ||
</section> | ||
|
||
<section title="Validation Keywords for Any Instance Type" anchor="general"> | ||
<section title="type"> | ||
<t> | ||
|
@@ -418,6 +435,12 @@ | |
result is a boolean "true" and the instance array length is less than or | ||
equal to the "maxContains" value. | ||
</t> | ||
<t> | ||
If annotations are not being collected, the validation value may be determined | ||
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. In terms of phrasing this should use MAY, and I feel the wording could be condensed a bit, but I do not feel strongly about that so feel free to ignore. (the condensing part- the "may" should really be a MAY). 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. This paragraph is simply describing the alternative algorithm to use that doesn't involve annotations. MAY in the RFC sense isn't correct here as alternative behaviour is not permitted -- it's only the implementation can vary. How about "can"? 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. I was just going by this language from the
As long as they end up consistent I'm probably fine with whatever. If making it consistent gets bogged down, I'll live with a little inconsistency. It is probably better to use "can" than lower-case "may", although that is definitely not an absolute rule. 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. Sounds like a reaonsable change. Let's go with "can". 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. I'm cutting out this entire part of the revision, since (as per other PRs recently submitted) trying to define a parallel implementation using annotations is not going to be identicaly, so we shouldn't suggest it at all. |
||
by considering the number of instance elements that are valid against the | ||
"contains" schema: validation is successful if and only if the number of valid | ||
elements is less than or equal to the "maxContains" value. | ||
</t> | ||
</section> | ||
|
||
<section title="minContains"> | ||
|
@@ -437,10 +460,17 @@ | |
annotation result is a boolean "true" and the instance array length is | ||
greater than or equal to the "minContains" value. | ||
</t> | ||
<t> | ||
If annotations are not being collected, the validation value may be determined | ||
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. /may/can/ again here? |
||
by considering the number of instance elements that are valid against the | ||
"contains" schema: validation is successful if and only if the number of valid | ||
elements is greater than or equal to the "minContains" value. | ||
</t> | ||
<t> | ||
A value of 0 is allowed, but is only useful for setting a range | ||
of occurrences from 0 to the value of "maxContains". A value of | ||
0 with no "maxContains" causes "contains" to always pass validation. | ||
of occurrences from 0 to the value of "maxContains". A value of | ||
0 causes "contains" to always pass validation (but validation can still fail | ||
against a "maxContains" keyword). | ||
</t> | ||
<t> | ||
Omitting this keyword has the same behavior as a value of 1. | ||
|
@@ -701,30 +731,34 @@ | |
<list style="hanging"> | ||
<t hangText="date-time:"> | ||
A string instance is valid against this attribute if it is | ||
a valid representation according to the "date-time" production. | ||
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. As before, production is correct, although I think "rule" is also correct as it's what is used in the RFC for ABNF, so perhaps that would be more agreeable? Specifically, date and time are from these ABNF rules in section 5.6 of RFC 3339: date-fullyear = 4DIGIT
date-month = 2DIGIT ; 01-12
date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on
; month/year
time-hour = 2DIGIT ; 00-23
time-minute = 2DIGIT ; 00-59
time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second
; rules
time-secfrac = "." 1*DIGIT
time-numoffset = ("+" / "-") time-hour ":" time-minute
time-offset = "Z" / time-numoffset
partial-time = time-hour ":" time-minute ":" time-second
[time-secfrac]
full-date = date-fullyear "-" date-month "-" date-mday
full-time = partial-time time-offset
date-time = full-date "T" full-time and duration comes from RFC 3339 Appendix A, ported from the ISO spec: dur-second = 1*DIGIT "S"
dur-minute = 1*DIGIT "M" [dur-second]
dur-hour = 1*DIGIT "H" [dur-minute]
dur-time = "T" (dur-hour / dur-minute / dur-second)
dur-day = 1*DIGIT "D"
dur-week = 1*DIGIT "W"
dur-month = 1*DIGIT "M" [dur-day]
dur-year = 1*DIGIT "Y" [dur-month]
dur-date = (dur-day / dur-month / dur-year) [dur-time]
duration = "P" (dur-date / dur-time / dur-week) 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. How about FWIW that would also resolve the previous confusion I'd raised about duration, where the ABNF rule in RFC3339 is very much incomplete compared to the actual ISO 8601 definition.. so we can be specific that we're only targeting what's in the RFC. (We can also optionally validate the remainder of the ISO 8601 definition, as those cases are explicitly omitted from the test suite.) 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. @karenetheridge I'm confused, I think "rule" (with the RFC section number, which is already there) is sufficient, although I would not object to ABNF so that's fine. 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. I find the use of the word "production" to be very confusing and would prefer we avoid using it unless it's referencing something very specific, in which case we should link to its definition somewhere in the preamble like we do for MUST/MAY/RECOMMENDS etc. 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. The tone of the comment I made here was too condescending. I am leaving this up for transparency so anyone who wants to can look at the edit history. I am otherwise withdrawing the comment. |
||
</t> | ||
a valid "date-time" representation according to the specification | ||
referenced above | ||
</t> | ||
<t hangText="date:"> | ||
A string instance is valid against this attribute if it is | ||
a valid representation according to the "full-date" production. | ||
</t> | ||
a valid "full-date" representation according to the specification | ||
referenced above | ||
</t> | ||
<t hangText="time:"> | ||
A string instance is valid against this attribute if it is | ||
a valid representation according to the "full-time" production. | ||
</t> | ||
a valid "full-time" representation according to the specification | ||
referenced above | ||
</t> | ||
<t hangText="duration:"> | ||
A string instance is valid against this attribute if it is | ||
a valid representation according to the "duration" production. | ||
</t> | ||
a valid "duration" representation according according to the | ||
specification referenced above | ||
</t> | ||
</list> | ||
</t> | ||
<t> | ||
Implementations MAY support additional attributes using the other | ||
production names defined anywhere in that RFC. If "full-date" or "full-time" | ||
format names defined anywhere in that RFC. If "full-date" or "full-time" | ||
are implemented, the corresponding short form ("date" or "time" | ||
respectively) MUST be implemented, and MUST behave identically. | ||
Implementations SHOULD NOT define extension attributes | ||
with any name matching an RFC 3339 production unless it validates | ||
according to the rules of that production. | ||
with any name matching an RFC 3339 format unless it validates | ||
according to the rules of that format. | ||
<cref> | ||
There is not currently consensus on the need for supporting | ||
all RFC 3339 formats, so this approach of reserving the | ||
|
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.
"production" is the correct term. Specifically, this:
is the NCName production in the XML Namespaces spec. In section 7, that spec says: "MUST match this specification's production for NCName.", so the terminology lines up. Type is definitely not correct, as that word has other meanings in an XML context.
So for this one we should really keep "production", although see my comments on the date-time formats for alternatives in that case.
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.
@karenetheridge does your thumbs up mean you agree and this should be removed from 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.
yes, it's an "okay, I accept this."
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.
OK, do you want to interactive rebase, remove the commit related to productions and force push? =]