v5 Proposals

Henry Andrews edited this page Dec 30, 2016 · 38 revisions

This wiki is out of date. Please see the new json-schema-org/json-schema-spec repository.

NOTE: Since this list was proposed, v5 has become a minimal cleanup of v4, so these features are primarily now targeted at v6. These proposals may or may not all be accepted, and others may be added.

General features

  • $data - allow schemas to use values from the data, specified using Relative JSON Pointers
  • Multilingual meta-data - allow keywords such as title to provide a map from language codes to values (e.g. {"title":{"en":"Example schema", "zh-tw": ...}})
  • Named enumerations - allow annotations for enum values
  • Document "ban unknown properties" mode - an optional (and non-default) extra check for undocumented properties
  • Custom error messages with errors keyword.

Validation/structural features

  • Allow alternative string values for type (reverting to v3 behaviour)
  • switch - allow conditional schemas ("when X, then Y") in a sequence of fallbacks
  • patternGroups and patternRequired - like patternProperties but with min/max constraints and required with patterns.
  • contains - array must contain at least one item matching this schema
  • constant - constant values, tidier than single-value enum
  • bounding - prevent anyOf/oneOf from failing to the "No valid schemas" error. See Concerns

Hyper-schema features

  • Extended templating syntax - allow templating using data outside the immediate properties, and more
  • Templating for rel and maybe others - allow extraction of more than just target URIs for links
  • propertyLinks - allow description of parent-child relationship, not just child format (possibly including link relation?)
  • baseUri - provide a base URI for resolving links in data, without implying anything else.
  • linkSource - allow a link definition to specify a subject instance other than the data being described

Semantic: format-related (optional)

Any new keywords would be totally non-compulsory, in exactly the same way as format.

  • formatMinimum/formatMaximum - allow format-specific min/max.
  • Re-introduction of some v3 format values: "date", "time", "utc-millisec" and "regex"
  • Additional values: "json-pointer", "relative-json-pointer", "uri-template"
  • unordered - declare that ordering of array items is irrelevant

Meta keywords related