deprecated keyword indicates that applications should refrain from using the declared property or schema. It signals that a feature may be removed in future versions.
Syntax
The value ofdeprecated must be a boolean.
Purpose
Thedeprecated keyword is a metadata annotation that:
- Marks properties or schemas as deprecated
- Signals that a feature may be removed in future versions
- Helps developers migrate away from outdated fields
- Can be used by tools to warn about deprecated usage
- Has no effect on validation (it is purely informational)
true value.
Behavior
Property Deprecation
Thedeprecated keyword applies to each instance location to which the schema object containing the keyword successfully applies. This can result in scenarios where every array item or object property is deprecated even though the containing array or object is not.
Root Schema Deprecation
A root schema containingdeprecated with a value of true indicates that the entire resource being described may be removed in the future.
Default Behavior
Omitting this keyword has the same behavior as a value offalse.
Examples
Deprecated Property
username property is marked as deprecated, signaling that developers should use email instead.