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 Draft 4
Changed In None
Introduced In Draft 1
Vocabulary Validation
Specification https://json-schema.org/draft-04/draft-fge-json-schema-validation-00#rfc.section.6.1
Metaschema http://json-schema.org/draft-04/schema#
Official Tests None
Default None
Annotation None
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 is merely descriptive and does not affect validation.

Examples

A schema that declares a top level description alongside a short title Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Even Number",
  "description": "This schema describes an even number",
  "type": "number",
  "multipleOf": 2
}
Valid An even number value is valid Instance
10
Invalid An odd number value is invalid Instance
7
A schema that declares conditional descriptions alongside a top level title Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Number",
  "type": "number",
  "anyOf": [
    {
      "description": "This is an even number",
      "multipleOf": 2
    },
    {
      "description": "This is an odd number",
      "not": {
        "multipleOf": 2
      }
    }
  ]
}
Valid An even number value is valid Instance
10
Valid An odd number value is valid Instance
7
Invalid A non-number value is invalid Instance
"Hello World"