$comment : String

$comment

String

This keyword reserves a location for comments from schema authors to readers or maintainers of 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 Reserved Location
Applies To Any
Base Dialect 2020-12
Changed In None
Introduced In Draft 7
Vocabulary Core
Specification https://json-schema.org/draft/2020-12/json-schema-core.html#section-8.3
Metaschema https://json-schema.org/draft/2020-12/meta/core
Official Tests None
Default None
Annotation None
Affected By None
Affects None

The $comment keyword is a standardised placeholder for explanatory string schema comments. This keyword is completely ignored by the evaluation process and it is possible to strip instances of this keyword when distributing your schemas for the purpose of space-efficiency. This keyword is commonly used to declare TODO comments in various parts of a schema.

Examples

A schema that declares a top level and a nested comment Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$comment": "This is an internal note about the schema that is ignored by the evaluation process",
  "properties": {
    "name": {
      "$comment": "TODO: Add `pattern` to better validate names",
      "type": "string"
    }
  }
}
Valid Any string value is valid and no annotations are emitted Instance
{ "name": "John Doe" }