Skip to content

Core vocabulary? #567

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

Closed
handrews opened this issue Mar 13, 2018 · 1 comment
Closed

Core vocabulary? #567

handrews opened this issue Mar 13, 2018 · 1 comment

Comments

@handrews
Copy link
Contributor

In a multi-vocabulary system (#561), should it be possible to explicitly reference the core vocabulary? Should it be required to do so?

Keep in mind that vocabularies are listed in meta-schemas, not in individual schemas, so the number of times your average schema author will need to do this is quite small.

The main use case for listing the core vocabulary is identifying which version of core is in use (e.g. draft-08), since it is not necessary for all vocabulary draft numberings to match. In particular, extension vocabularies and meta-schema will likely not indicate a draft number, so anything that relies on matching draft-NN in the URI is not feasible.

Here is what a core vocabulary meta-schema would probably look like (note that per #513, the applicators are their own vocabulary even if the live in the core specification):

{
  "$id": "http://json-schema.org/draft-08/vocabularies/core",
  "$schema": "http://json-schema.org/draft-08/schema#",
  "type": ["object", "boolean"],
  "properties": {
    "$id": {"type": "string", "format": "uri-reference"},
    "$schema": {"type": "string", "format": "uri"},
    "$recurse": {"type": "boolean", "const": true},
    "$ref": {"type": "string", "format": "uri-reference"},
    "$defs": {"type": "object", "additionalProperties": {"$recurse": true}},
    "$comment": {"type": "string"}
  }
}

My inclination would be to publish such a vocabulary schema, and use it in the meta-schemas. This is the most consistent and clear approach, and allows the most flexibility for extensions.

@handrews
Copy link
Contributor Author

We decided that if $vocabulary is used at all, the core vocab is mandatory to list. Merged #671.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant