Basic Metadata
title
title
Type: StringPurpose: Provides a short, human-readable title for a schema.The
title keyword is used to provide a concise label for schemas, particularly useful for UI generation and documentation.Behavior:- Value MUST be a string
- Produces an annotation result
- Does not affect validation
- Should be short and descriptive
description
description
Type: StringPurpose: Provides a detailed explanation of the schema’s purpose and usage.The
description keyword offers more comprehensive documentation than title, explaining what the schema represents and how it should be used.Behavior:- Value MUST be a string
- Produces an annotation result
- Does not affect validation
- May be longer and more detailed than
title
default
default
Type: Any JSON valuePurpose: Supplies a default value for a schema location.The
default keyword suggests a default value that applications may use when an instance value is not provided.Behavior:- Value can be any JSON type
- Produces an annotation result
- Does not affect validation
- The default value SHOULD be valid against the schema
- When multiple
defaultvalues are applicable, implementations SHOULD remove duplicates
examples
examples
Type: Array (any values)Purpose: Provides sample values that are valid for the schema.The
examples keyword supplies one or more example values to illustrate valid instances, useful for documentation and testing.Behavior:- Value MUST be an array
- No restrictions on the values within the array
- Produces an annotation result
- Does not affect validation
- Values SHOULD be valid against the schema
- When multiple occurrences apply, implementations MUST provide a flat array of all values
- Implementations MAY use
defaultas an additional example if present
deprecated
deprecated
Type: BooleanPurpose: Indicates that a schema or property should no longer be used.The
deprecated keyword marks schemas or properties as outdated, signaling to developers and tools that they should avoid using them.Behavior:- Value MUST be a boolean
- Produces an annotation result
- Does not affect validation
- If
true, indicates applications SHOULD refrain from using the property - May mean the property will be removed in the future
- When multiple occurrences apply, if ANY specify
true, the location is deprecated - Omitting has the same behavior as
false
Access Control Metadata
readOnly
readOnly
Type: BooleanPurpose: Indicates that a value is managed by the owning authority and should not be modified.The
readOnly keyword marks properties that are managed exclusively by the server or system and should not be set by clients.Behavior:- Value MUST be a boolean
- Produces an annotation result
- Does not affect validation
- If
true, indicates the value is managed by the owning authority - Attempts to modify read-only values should be ignored or rejected
- Can assist with UI generation (e.g., disabled input fields)
- When multiple occurrences apply, if ANY specify
true, treat as read-only - Omitting has the same behavior as
false
writeOnly
writeOnly
Type: BooleanPurpose: Indicates that a value should only be sent to the server, never returned.The
writeOnly keyword marks properties that can be set but will never be returned when retrieving data, typically used for sensitive information.Behavior:- Value MUST be a boolean
- Produces an annotation result
- Does not affect validation
- If
true, indicates the value is never present when retrieved from the owning authority - Can be present when creating or updating but won’t be in responses
- Can assist with UI generation (e.g., password input fields)
- When multiple occurrences apply, if ANY specify
true, treat as write-only - Omitting has the same behavior as
false
Format Annotation
format
format
Type: StringPurpose: Provides semantic information about the string value’s format.The
format keyword conveys semantic information about string values and can optionally be used for validation. It describes standardized formats like email addresses, dates, and URIs.Behavior:- Value MUST be a string
- Produces both an annotation and assertion result
- Primarily applies to strings, but can be defined for any type
- Implementations SHOULD provide assertion behavior for defined formats
- Implementations MUST refuse to process schemas with unsupported format values
date-time- RFC 3339 date-timedate- RFC 3339 full-datetime- RFC 3339 full-timeduration- ISO 8601 durationemail- RFC 5321 email addresshostname- RFC 1123 hostnameipv4- IPv4 addressipv6- IPv6 addressuri- RFC 3987 IRIuri-reference- RFC 3986 URI referenceuuid- RFC 4122 UUIDregex- ECMA-262 regular expressionjson-pointer- RFC 6901 JSON Pointer
Content Encoding and Media Type
These keywords describe string-encoded data.contentEncoding
contentEncoding
Type: StringPurpose: Indicates that a string value contains encoded binary data.The
contentEncoding keyword specifies the encoding used for binary data represented as a string, such as base64.Behavior:- Value MUST be a string
- Produces an annotation result
- Does not affect validation
- Only applies to string instances
- Common values:
base64,base32,base16(from RFC 4648) - If absent but
contentMediaTypeis present, encoding is identity (no transformation)
contentMediaType
contentMediaType
Type: String (media type)Purpose: Indicates the media type of string contents.The
contentMediaType keyword describes the type of content in a string value, particularly when combined with contentEncoding.Behavior:- Value MUST be a string
- Value MUST be a media type per RFC 2046
- Produces an annotation result
- Does not affect validation
- Only applies to string instances
- If
contentEncodingis present, describes the decoded content
contentSchema
contentSchema
Type: Valid JSON SchemaPurpose: Describes the structure of string-encoded content.The
contentSchema keyword provides a schema for validating the structure of data embedded as a string, typically used with contentMediaType.Behavior:- Value MUST be a valid JSON Schema
- Produces an annotation result (the subschema itself)
- Does not affect validation of the containing schema
- Only applies to string instances
- SHOULD NOT produce annotation if
contentMediaTypeis absent - Applications must separately decode and validate the string content