Media type registration #198
Replies: 4 comments 43 replies
-
Here's another option. It's not perfect either, but while writing this up I remembered that this was how I reconciled this problem in the first place. If this is how we want to approach it, the registration should be updated to make this clear. It should say that if the identified dialect is not directly understood by the client, information about how to process the schema may be encoded in the meta-schema identified by the dialect id. Then implementations that support 2019-09 and 2020-12 know to look for a known core vocabulary declaration in the That's pretty open ended, but it's compatible with all existing versions and doesn't constrain us in the future. We're free to change It's not perfect because it doesn't fully define how to determine which specification to use to process the schema, it delegates some of that the identification process to individual dialects. But, it works and it's compatible with past and future. I think this is the best option we have. |
Beta Was this translation helpful? Give feedback.
-
Because of this:
Can we talk about standardizing processing rules identification instead of dialect identification? The dialect is actually irrelevant except when it's the only available identifier for the processing rules. And in that case it's serving two roles rather than really being about dialect. (I will come back and add an example about the |
Beta Was this translation helpful? Give feedback.
-
What does this mean in technical terms? Can we come up with some examples of things that we would like to enable, that would not be possible just by referencing 2020-12? |
Beta Was this translation helpful? Give feedback.
-
I'm supportive of getting these registered... let me know how I can help. |
Beta Was this translation helpful? Give feedback.
-
The JSON Schema specification defines the
application/schema+json
andapplication/schema-instance+json
, but these media types have never been officially registered with the IANA. We're in the process of getting those media types registered. We met yesterday to discuss our approach and some potential problems.What we define should work for all past a future releases of JSON Schema and their existing implementations as well as custom versions such as OpenAPI and MongoDB. In other words, we're not designing something ideal from scratch. We're defining something that is compatible with how past and current implementation use these media types.
The approach we are taking is to standardize only dialect identification in the media type registration and deferring the rest of how to interpret the document to the specific JSON Schema specification that was identified. For example, if
http://json-schema.org/draft-07/schema#
is identified, then the document should be interpreted based on the draft-07 specification.These are all ways the dialect can be identified with items at the top of the list taking precedence over items lower in the list.
However, this doesn't technically work for 2019-09 and 2020-12 because it's not
$schema
that determines how a schema is processed, it's$vocabulary
. That leaves us with only bad options. Here are some of the things we discussed.$vocabulary
as well as$schema
.This isn't a good option because
$vocabulary
is still evolving and is likely to change.$vocabulary
.That's more likely to be stable than
$vocabulary
, but since it's a new keyword and part of the vocabulary system that is likely to change, it's very possible we don't get this right the first time.$schema
of the meta-schema instead of the core vocabulary declared in$vocabulary
to determine how to process the schema.Although technically not correct, this seems to be the approach that most implementations have taken because using
$vocabulary
for core vocabulary identification is somewhat problematic. There were some comments that this approach would allow you do some strange things. I didn't follow that in the discussion. This would be a good place to give an example of what that meant.Beta Was this translation helpful? Give feedback.
All reactions