Skip to main content
The description keyword provides a detailed, human-readable explanation of the schema. It is used to document the purpose and usage of the data described by the schema.

Syntax

The value of description must be a string.

Purpose

The description keyword is a metadata annotation that:
  • Provides detailed explanation about the purpose of the instance described by the schema
  • Enhances documentation with contextual information
  • Helps developers understand the intended use of data fields
  • Can be displayed in user interfaces to guide users
  • Has no effect on validation (it is purely informational)
A description provides comprehensive explanation, whereas a title is preferably short and concise.

Examples

Basic Usage

This schema includes both a short title and a detailed description explaining the purpose of the email field.

Complex Object Documentation

Detailed descriptions help developers understand business rules and constraints for each field.

API Endpoint Parameter

The description explains both the purpose and the reasoning behind the constraints.

Configuration Schema

Descriptions provide operational context and best practices for configuration values.

Validation Rules Documentation

The description explains the format pattern in human-readable terms with examples.

Enum Values Explanation

The description provides workflow context for the enumerated values.

Best Practices

Include Usage Context

Good descriptions explain not just what the field is, but how it’s used:

Document Defaults and Edge Cases

Provide Examples When Helpful