How do I mark a property in JSON schema as deprecated? How do I mark a property in JSON schema as deprecated? json json

How do I mark a property in JSON schema as deprecated?


Draft 2019-09 of the JSON Schema Validation spec, published on 2019-09-16, now defines the deprecated meta-data annotation:

The value of this keyword MUST be a boolean. When multiple occurrences of this keyword are applicable to a single sub-instance, applications SHOULD consider the instance location to be deprecated if any occurrence specifies a true value.

If "deprecated" has a value of boolean true, it indicates that applications SHOULD refrain from usage of the declared property. It MAY mean the property is going to be removed in the future.

A root schema containing "deprecated" with a value of true indicates that the entire resource being described MAY be removed in the future.

When the "deprecated" keyword is applied to an item in an array by means of "items", if "items" is a single schema, the deprecation relates to the whole array, while if "items" is an array of schemas, the deprecation relates to the corrosponding [sic] item according to the subschemas position.

Omitting this keyword has the same behavior as a value of false.


Not currently, but it is planned for a future version of the specification.Discussion to the effect happened on https://github.com/json-schema-org/json-schema-spec/issues/74

Henry added it to the draft-future milestone in Sep 2017, but there are still issues to work out before we can get to it.

Update, see other answer regarding draft 2019-09 publication!