-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Reorganizing the meta-schemas #1159
Comments
I'm not sure how this makes anything easier. Vocabularies should be organized to make it easy to combine them to make new dialects. For example, if I'm defining a dialect for data definition, I might want applicator keywords, but not validation keywords that don't apply to the ddl domain. The current organization isn't perfect, but I don't see how the proposal is better. I can't imagine how splitting by JSON type would be useful for constructing dialects. Why would I ever want my dialect to support object keywords and not array keywords? |
Maybe you don't need arrays with your data model. But I'm not asking that question. I'm asking why keywords for arrays exist in multiple vocabs. In particular to this case, what is the use of separating Organization by "keyword type" doesn't really seem helpful to anyone other that spec authors. |
This is exactly the example I gave. If I'm creating a DDL dialect, I only want keywords that I can apply to data-types. However, vocabulary organization is arbitrary and no matter what we choose, there will always be use cases where it doesn't make sense. I'd rather define keywords than vocabularies. Then people can combine them however they like without being constrained by the categorization we choose for them. |
This table would certainly be useful to include on the documentation site; there are lots of keywords and categorizing them in different ways can make it easier for a schema author to find what they need. Perhaps a list of all the keywords, with a column for what vocabulary they belong to (and a link to the spec entry for each), and a column showing what instance type(s) they are applicable for? ..so basically a simplified form of https://docs.google.com/spreadsheets/d/18SIXnzyjXTJZgqeo5W-qIEwq-bNKXb5M76Pq_47r2Is/edit#gid=0 |
I don't know that the average schema author is going to be creating dialects, though. That involves writing meta-schemas. Most schema authors are just going to be just taking the base meta-schema. If I am such a schema author, I don't know what an "applicator" is. I just have an array, and I need to write a schema. To do that, I want to know what keywords I can use that pertain to arrays. As it stands, I have to look in With the proposed organization, all I have to do is look at the
The ones I list under But more to the point here is the example I mentioned earlier. How can you properly define the structure of, say, an array without all of the keywords that pertain to arrays, e.g. both I think we're making things harder for John & Jane Schema-Author.
I see this as a secondary option, but I think there's value in actually reorganizing the vocabularies themselves. |
I'm not convinced, given:
|
When we get around to documenting vocabularies, I agree that something like this would be useful.
I completely agree. Most schema authors won't be creating dialects. But, the only reason for anyone to care about vocabularies is if they are creating dialects. They're otherwise a fairly irrelevant concept to the average schema author. What you are describing sounds like documentation concerns. People are definitely not going to be digging through meta-schemas to see what keywords are available to them. The UJS site is already organized very much the way you've broken things down, so I'm not seeing a major problem here.
The vocabulary breakdown is definitely not perfect. There are certainly some minor improvements we can make, but no matter what we choose, it will make sense in one circumstance and not in another. This is why I want to move away from keywords being identified by their vocabulary. If keywords are identified independently, everyone can group keywords into vocabularies however works best for them. I already answered how What would make sense to me would be a vocab for basic structural JSON definition. It would contain everything you need for basic type definition like |
For what it's worth, that's what I did when I first picked up JSON Schema. |
Point taken. This was too strong a statement. I'll rephrase to, "In my experience, it's very uncommon for people to be digging through meta-schemas to see what keywords are available to them". I'm willing to accept that it's more common than I think. I just meant to express that I've never heard of anyone doing this until now. |
I'm moving this conversation to a discussion. Will report back here once decided. |
This conversation needs to be reframed in the context of not having vocabularies. I think there is still a benefit to having some grouping of keywords, but it needs to be stated outside of the vocabulary context. |
I'm removing this from the stable release discussion since this really involves vocabs, which are being demoted to a proposal. (I'll open a different issue for a related discussion we need to have.) |
Currently, the keywords are organized based on what "kind" of keyword they are: applicator vs annotation vs assertion (vs "special").
I think it might be easier for schema authors if we organized the keywords by function. This table reorganizes the keywords primarily by what kind of data the keyword addresses. It still has some "special" categories as well.
format
is still on its own so that we can include it withfalse
while leaving the door open to others using it withtrue
.Aside from that, I think this organization makes more sense from an author's point of view.
The text was updated successfully, but these errors were encountered: