description : String

description

String

An explanation about the purpose of the instance described by the schema.

Value This keyword must be set to a string Hint: Use the jsonschema metaschema and jsonschema lint commands to catch keywords set to invalid values
Kind Annotation
Applies To Any
Base Dialect 2020-12
Changed In None
Introduced In Draft 1
Vocabulary Meta Data
Specification https://json-schema.org/draft/2020-12/json-schema-validation.html#section-9.1
Metaschema https://json-schema.org/draft/2020-12/meta/meta-data
Official Tests None
Default None
Annotation String The description set by this keyword Hint: Use the jsonschema validate command to collect annotations from the command-line
Affected By None
Affects None
Also See

The description keyword is a placeholder for a longer human-readable string summary of what a schema or any of its subschemas are about. This keyword does not affect validation, but the evaluator will collect its value as an annotation.

Examples

A schema that declares a top level description alongside a short title Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Even Number",
  "description": "This schema describes an even number",
  "type": "number",
  "multipleOf": 2
}
Valid An even number value is valid and annotations are emitted Instance
10
Annotations
{ "keyword": "/title", "instance": "", "value": "Even number" }
{ "keyword": "/description", "instance": "", "value": "This schema describes an even number" }
Invalid An odd number value is invalid and no annotations are emitted Instance
7
A schema that declares conditional descriptions alongside a top level title Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Number",
  "type": "number",
  "if": { "multipleOf": 2 },
  "then": { "description": "This is an even number" },
  "else": { "description": "This is an odd number" }
}
Valid An even number value is valid and the corresponding description annotation is emitted Instance
10
Annotations
{ "keyword": "/title", "instance": "", "value": "Number" }
{ "keyword": "/then/description", "instance": "", "value": "This is an even number" }
Valid An odd number value is valid and the corresponding description annotation is emitted Instance
7
Annotations
{ "keyword": "/title", "instance": "", "value": "Number" }
{ "keyword": "/else/description", "instance": "", "value": "This is an odd number" }
Invalid A non-number value is invalid and no annotations are emitted Instance
"Hello World"