Looking to master JSON Schema for OpenAPI?

A 9+ hour course taught by a member of the JSON Schema Technical Steering Committee

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 7
Changed In None
Introduced In Draft 1
Vocabulary Validation
Specification https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.10.1
Metaschema http://json-schema.org/draft-07/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-07/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-07/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 Instance
10
Valid An odd number value is valid Instance
7
Invalid A non-number value is invalid Instance
"Hello World"