Skip to content

Summary of JSON Schema changes (Core & Validation)

German Bisurgi edited this page May 22, 2023 · 5 revisions

JSON Schema 6

  • "id"replaced by "$id"; "$id" replaces "id"
  • "$ref" only allowed where a schema is expected
  • "exclusiveMinimum" and "exclusiveMaximum" changed from a boolean to a number
  • booleans as schemas, i.e., true is equivalent to {}, false is equivalent to {"not": {}}
  • "propertyNames"
  • "contains"
  • "const"
  • "required" allows an empty array
  • "dependencies" allows an empty array for property dependencies
  • "format": "uri-reference", "uri-template", "json-pointer"
  • "examples"

JSON Schema 7

  • "$comment"
  • "if", "then", "else"
  • "readOnly"
  • "writeOnly"
  • "contentMediaType"
  • "contentEncoding"
  • more formats: "iri", "iri-reference", "uri-template", "idn-email", "idn-hostname", "relative-json-pointer", "regex", "date", "time"

JSON Schema 2019-09

  • by default, format is no longer an assertion.
  • $anchor
  • $defs (renamed from definitions)
  • $id - only URI-references without fragments are allowed
  • $recursiveAnchor and $recursiveRef
  • $ref- other keywords are now allowed alongside of it
  • $vocabulary
  • dependentSchemas (split from dependencies)
  • unevaluatedItems
  • unevaluatedProperties
  • dependentRequired (split from dependencies)
  • maxContains and minContains
  • more formats: "duration", "uuid"
  • contentSchema
  • deprecated

JSON Schema 2020-12

  • $dynamicAnchor and $dynamicRef
  • prefixItems
  • validation output formats:
    • "flag", "basic", "detailed", or "verbose";
    • "valid", "errors", "annotations"
    • keywordLocation, absoluteKeywordLocation, instanceLocation
  • format: date-time, email, idn-email