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
Kind Annotation
Applies To Any
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
Affected By None
Affects None
Also See

The title keyword in JSON Schema is used to provide a human-readable label for a schema or its parts. It does not affect data validation but serves as an informative annotation.

Examples

Schema with 'title' keyword Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Age of a person",
  "type": "number"
}
Valid An instance with a numeric value is valid Instance
45
Annotations
{ "keyword": "/title", "instance": "", "value": "Age of a person" }
Schema with logical operators Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Personal Info",
  "properties": {
    "name": { "type": "string" },
    "age": { "type": "number" }
  },
  "if": {
    "title": "if block",
    "properties": {
      "age": { "title": "'if' true", "minimum": 18 }
    }
  },
  "then": {
    "title": "then block",
    "properties": {
      "eligible": { "title": "then applied", "const": true }
    }
  },
  "else": {
    "title": "else block",
    "properties": {
      "eligible": { "title": "else applied", "const": false }
    }
  }
}
Valid Instance
{
  "name": "John Doe",
  "age": 25,
  "eligible": true
}
Annotations
{ "keyword": "/title", "instance": "", "value": "Personal Info" }
{ "keyword": "/if/title", "instance": "", "value": "if block" }
{ "keyword": "/if/properties/age/title", "instance": "/age", "value": "'if' true" }
{ "keyword": "/then/title", "instance": "", "value": "then block", }
{ "keyword": "/then/properties/eligible/title", "instance": "/eligible", "value": "then applied" }
Schema with multiple annotations for the same instance Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Person's name",
  "$ref": "#/$defs/name",
  "$defs": {
    "name": {
      "title": "Person's name",
      "type": "string"
    }
  }
}
Valid Instance
"John Doe"
Annotations
{ "keyword": "/title", "instance": "", "value": "Person's name" }
{ "keyword": "/$ref/title", "instance": "", "value": "Person's name" }