title : String
title
StringA 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": "https://json-schema.org/draft/2020-12/schema",
"title": "Age of a person",
"type": "number"
}
45
{ "keyword": "/title", "instance": "", "value": "Age of a person" }
{
"$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 }
}
}
}
{
"name": "John Doe",
"age": 25,
"eligible": true
}
{ "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": "https://json-schema.org/draft/2020-12/schema",
"title": "Person's name",
"$ref": "#/$defs/name",
"$defs": {
"name": {
"title": "Person's name",
"type": "string"
}
}
}
"John Doe"
{ "keyword": "/title", "instance": "", "value": "Person's name" }
{ "keyword": "/$ref/title", "instance": "", "value": "Person's name" }