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
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 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 is merely descriptive and does not affect
validation.
Best Practice
We heavily recommend to declare this keyword at the top level of every schema, as a human-readable introduction to what the schema is about.
When doing so, note that the JSON Schema specification does not impose or
recommend a maximum length for this keyword. However, it is common practice to
stick to Git commit message
title
conventions and set it to a capitalised string of 50 characters or less. If
you run out of space, you can move the additional information to the
description
keyword.
Examples
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Even Number",
"type": "number",
"multipleOf": 2
}
10
7
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Number",
"type": "number",
"if": { "multipleOf": 2 },
"then": { "title": "Even Number" },
"else": { "title": "Odd Number" }
}
10
7
"Hello World"