Still Kinda Supporting Unknown Keywords - A call for proposals #329
Replies: 10 comments 90 replies
-
Solution proposal: Define a convention that SVA keywords begin with This would allow users to include ad-hoc SVAs without needing to create a vocabulary to contain them, similarly to how they use unknown keywords now. |
Beta Was this translation helpful? Give feedback.
-
Solution proposal: Inlined vocabularies to define SVA keywords just for that meta-schema. The API for this isn't really defined, but as a quick thought, maybe something like this could work:
This says a vocabulary identified as The advantage here is that the definition for SVAs stays within the vocabulary system. |
Beta Was this translation helpful? Give feedback.
-
Solution proposal: A new keyword that identifies SVA keywords just for that schema.
This is similar to the ad-hoc vocab but less verbose. |
Beta Was this translation helpful? Give feedback.
-
Solution proposal: Define a configuration option that allows users to declare whether they want to allow unknown keywords. This is similar to how format assertions can be enabled via a configuration option. |
Beta Was this translation helpful? Give feedback.
-
I have no objection to the next version disallowing unknown keywords (and including That gives everyone a place to put their
|
Beta Was this translation helpful? Give feedback.
-
We've settled on the idea of using a prefix to allow unknown keywords, but there's some disagreement about exactly how that mechanism would work. Let's work this out. @gregsdennis originally proposed the prefix this way,
I suggested the following,
@karenetheridge has a similar view,
(I'll present my case later. This is just promoting the conversation for now) |
Beta Was this translation helpful? Give feedback.
-
This discussion is going so wrong... Everyone here says what they would like, but no one says what they would not like and why! The main preference of the json schema team is known: removing support for unknown keywords entirely! The discussion fails to attract answers from those who would be affected by this decision. Why would the json schema team bother to offer a solution to something that apparently nobody cares about? The json chema team is trying to offer a solution to what?
I think would be kind of impossible to understand the benefits of vocabularies with this documentation:
... same goes for:
... as for There are still a few topics like these, and I think it's no coincidence that these topics are the most misunderstood and unused... |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! Sharing here this discussion from the JSON-LD \ YAML LD discussions on similar topic. They suggest a new elegant alternative solution worth exploring. Thanks Orie for sharing this. |
Beta Was this translation helpful? Give feedback.
-
Not sure if this was proposed yet (the discussion is already too long), but just to throw it out there for the record: the Core vocabulary defines a keyword for reserving a location: { "$extra": { anything you want here } } Then we can avoid the prefix character discussion altogether. |
Beta Was this translation helpful? Give feedback.
-
Yet another idea... How about ignoring keywords based on a set of rules, like this:
|
Beta Was this translation helpful? Give feedback.
-
DECISION: The proposal to use a prefix was the much preferred option. After hosting a survey, the results indicated that most users like the idea of using
x-
as that prefix.Thank you to everyone who commented below and to those who participated in the survey.
Previously, on JSON Schema Discussions:
Now we need to figure out how to support the transition. Questions to answer here:
Is there a way that unknown keywords can still be supported?
In the proposal, Henry identified four categories for "unknown" keywords:
This discussion will focus on SVAs since these are the keywords that can reliably be supported by implementations without needing custom code. As Henry stated in his discussion:
(He also requested that solutions be discussed elsewhere. This discussion is that elsewhere.)
Despite the request, several ideas did crop up:
@
(or some other such symbol). (This would also require the contrapositive: that non-SVA keywords must not begin with@
.)The proposed solution in the opening comment has merit but is more of a long-term idea, and I think it requires more thought. In the meantime, we should look for simpler solutions.
I'll start threads for these so that we can have more targeted discussions for each of them. Please feel free to vote (👍/👎) for your preference at the root of the thread or leave another idea.
I think it's also important not to lose track of these things, which came up in that discussion.
Beta Was this translation helpful? Give feedback.
All reactions