-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
Review draft-08/core/9.4 - $defs: Clarify its a recommendation #778
Comments
@about-code does section 9.3.4 "References to Possible Non-Schemas" clarify this at all? It discusses things that could happen when putting re-usable subschemas under unexpected keywords. Perhaps a reference to that in 9.4 would help? |
In particular, a (sub)schema URI might be used as a format/conformance identifier within other representations. |
@stain I'm not sure I follow how that relates to this issue, could you elaborate? I agree that using a subschema's URI as an identifier outside of the schema is valid, I'm just not sure what that has to do with the recommended vs required nature of @about-code did you see my question above about the "References to Possible Non-Schemas" section? |
@handrews That's a great section you linked to. "subschemas SHOULD NOT be the value of unknown keywords and they SHOULD NOT be treated as a subschema, or be the target of a reference." I want to suggest to implementers that they may want to watch out for this and SHOULD thrown an error, in effort to guide schema authors away from this practice. |
@Relequestual we want people to create new applicator keywords in their vocabularies if they need them, so we don't actually want to discourage creating keywords with subschema values. "Unknown" really means "unknown to your implementation". There's nothing really unusual going on here- if your implementation doesn't understand a keyword, it's not going to work. This whole section just emphasizes that this is just as true for what I think of as "placeholder" keywords ( |
FWIW, I agree with the OP on a minor point, that it's worth being careful with the use of standard and standardized in the specification. Especially in industries that rely on Standards Organizations, the "level of force" intended by standardized could be unclear. An RFC 2119 term like RECOMMENDED would be better if appropriate. |
@garethsb-sony Thanks for the concern. |
OK, I do agree, using RFC 2119 terms if and only if 'force' is intended ought to be enough. Avoiding using RFC 2119 terms in lowercase (e.g. does 'should not' in https://github.com/json-schema-org/json-schema-spec/blob/master/jsonschema-core.xml#L327 have a different force than 'SHOULD' in the previous sentence and if so, why?), and similarly forceful sounding words, will help some readers, but it can often make the language tortuous! |
This is defind at the top of the document, as per the majority of RFC documents. That example you've picked specifically, maybe it could do with some tidying. |
In requests for reviewing draft-08 I would like to comment on
Core-Spec, Section 9.4. Schema Re-Use With "$defs"
In the original issue #512 @handrews stated that
$defs
is actually more of a recommendation whiledefinitions
and basically any other arbitrary keys (see #512 (comment)) should continue to work, too.Reading previous versions of the specification as well as draft-08, though, it is easy to read it as if
$defs
(and formerlydefinitions
) were the only possible spec-conformant place where to put subschemas. It is not very clear that it has been a recommendation. I guess the fine distinction to catch is the use of the phrase a standardized location rather than the standardized location and an absence of MUST. However, standardized sounds more reliable than it obviously is and doesn't indicate a recommendation at all.I think the spec would profit from using the wording the recommended location or from becoming even more clear with something like
The text was updated successfully, but these errors were encountered: