-
Notifications
You must be signed in to change notification settings - Fork 4
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
jsonschema: dialect identification #20
Comments
I think it's very important for dialect identification to be defined here. In fact, I don't think we can reference any specific part of the JSON Schema spec because it's a moving target. The JSON Schema spec isn't one thing. Releasing a new dialect doesn't replace or obsolete the previous one. The old dialects are still valid and have implementations and users. If we point to the JSON Schema spec to define dialect identification, which version of the spec do we point to? Will the next release take precedence? I can't imagine that the IETF would except the definition of a media type that can change without notice some time in the future. My goal is to standardize a media type that defines the bare minimum necessary to identify which dialect the schema uses and then delegate semantics of the schema to wherever the dialect is defined. Dialects can't decide how dialects are identified because if they did, they might have different rules and it would be unclear which rules to apply. There needs to be one authority and that's where this I-D comes in. Having the media type and dialect identification officially registered and stable means future JSON Schema releases can just be dialects without redefining the media type with every release. It also means third-party dialects don't need to be updated whenever a new JSON Schema dialect is released because they point to this stable I-D, not the previous JSON Schema release. I hope that made sense. |
Since dialect identification relies on the media type parameter, it is correct to define dialect identification in this I-D.
We then need to cite in future JSON Schema releases using the I'll add this issue to the slide so we can get some editorial feedback regarding the best strategy for doing this. |
Yep. That's the plan. |
Jumping back here from the discussion in PR #32, I want to follow up on what I think is a debate between:
Please let me know if I am mischaracterizing your positions! Furthermore, @awwright observed:
in response to @jdesrosiers's concern that the multiple versions of the JSON Schema Core specification mean that it is not possible to use any JSON Schema Core spec as a stable reference. I outlined what I thought a stable base specification could look like, but failed to make clear that I do not think that this media type registration needs to wait for all of that stable base to be finalized. Problems with meta-schema URIs and dialect identification
If you are only looking at standardized meta-schema URIs from the JSON Schema specification documents, then you are choosing among version dialects. If you know which processing rules are involved across all possible URIs and are looking at non-standardized URIs, then you are choosing among non-version dialects in the context of a known version. The problem being that, without a known version, a custom URI obliterates the draft/version information, which is what signifies the processing rules. Assuming vocabularies are used as expected, we should expect a proliferation of custom This was how I hoped to separate the processing rules from the keyword syntax and semantics. Otherwise I don't see how meta-schema URIs are viable for determining processing rules. Each implementation would have to know each URI in advance and know the processing rules associated with it, which defeats the purpose of being able to assemble a custom JSON Schema "fragmentation"Over in issue #32, in a conversation with @dret and @awwright, @jdesrosiers lamented that "it's unfortunate that JSON Schema has become fragmented". I've been trying to figure out what you meant, and I noticed that @awwright started https://github.com/orgs/json-schema-org/discussions/169 in response with "a more positive outlook." @jdesrosiers, if you are using the proliferation of meta-schema URIs as a metric for fragmentation, I understand your concern! As noted above, the vocabulary system was intentionally designed with the expectation that meta-schema URIs (and the dialects they represent) would proliferate more-or-less uncontrollably, on a relatively stable base of vocabulary URIs. I did this because I did not see any way to salvage The upshot of this is I don't think it's sufficient to explain An approach for handling both past and future.@awwright has advocated for including instructions for processing past drafts in the next iteration of the spec. You could alternatively do at least some of that in this document. What would that look like? Here's a quick proposal that might be missing some things, but you get the idea:
Each of the above could be enumerated, with their standardized meta-schemas. If you try to use them with custom meta-schemas, unless the implementation specifically recognizes them, you're out of luck. From that point on, If But I don't think |
That's a lot of good stuff to discuss, @handrews. I don't have time to fully address all of that, but I'll quickly address what I meant by fragmentation. I was referring to OpenAPI and MongoDB defining their own custom versions of JSON Schema. That doesn't include OpenAPI 3.1 which is a dialect of 2020-12, but does include OpenAPI 2.0 and 3.0 that make their own rules. I would prefer that this media type be defined in a way that is inclusive of those rouge versions because OpenAPI 3.0 users, for example, are likely to want to use this media type as well. |
I expect
cc: @Relequestual @jdesrosiers
The text was updated successfully, but these errors were encountered: