title : String

title

String

A preferably short description 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 title 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 title keyword is a placeholder for a concise 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 title Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "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" }
Invalid An odd number value is invalid and no annotations are emitted Instance
7
A schema that declares conditional refined titles for the same instance location Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Number",
  "type": "number",
  "if": { "multipleOf": 2 },
  "then": { "title": "Even Number" },
  "else": { "title": "Odd Number" }
}
Valid An even number value is valid and both the top level and even annotations are emitted Instance
10
Annotations
{ "keyword": "/title", "instance": "", "value": "Number" }
{ "keyword": "/then/title", "instance": "", "value": "Even Number" }
Valid An odd number value is valid and both the top level and odd annotations are emitted Instance
7
Annotations
{ "keyword": "/title", "instance": "", "value": "Number" }
{ "keyword": "/else/title", "instance": "", "value": "Odd Number" }
Invalid A non-number value is invalid and no annotations are emitted Instance
"Hello World"