Describe the inspiration for your proposal
Add deprecationMessage key (and value type is string).
{
"type": "object",
"properties": {
"key": {
"deprecated": true,
"deprecationMessage": "This key is deprecated from `2026-01-01`",
...
}
}
}
Describe the proposal
Currently, deprecated key only allows true and does not provide a way to convey additional information such as the date or background of when it occurred.
Editors like VSCode and JetBrains support deprecationMessage keyword, but they are not yet included in the official JSON Schema specification.
Therefore, I propose that we officially support this specification.
Describe alternatives you've considered
Allow string types for deprecated.
If a string is passed, the validator will return that string as a warning message.
{
"type": "object",
"properties": {
"key": {
"deprecated": "This key is deprecated from `2026-01-01`",
...
}
}
}
Or, we can introduce a more general warningMessage key.
{
"type": "object",
"properties": {
"key": {
"deprecated": true,
"warningMessage": {
"deprecated": "This key is deprecated from `2026-01-01`"
}
...
}
}
}
Additional context
VS Code already supports this.
microsoft/vscode-json-languageservice#226
This was brought up in the discussion below, but it wasn't the main topic, so it seems there hasn't been any progress.
#391
Describe the inspiration for your proposal
Add
deprecationMessagekey (and value type isstring).{ "type": "object", "properties": { "key": { "deprecated": true, "deprecationMessage": "This key is deprecated from `2026-01-01`", ... } } }Describe the proposal
Currently,
deprecatedkey only allowstrueand does not provide a way to convey additional information such as the date or background of when it occurred.Editors like VSCode and JetBrains support
deprecationMessagekeyword, but they are not yet included in the official JSON Schema specification.Therefore, I propose that we officially support this specification.
Describe alternatives you've considered
Allow string types for deprecated.
If a string is passed, the validator will return that string as a warning message.
{ "type": "object", "properties": { "key": { "deprecated": "This key is deprecated from `2026-01-01`", ... } } }Or, we can introduce a more general
warningMessagekey.{ "type": "object", "properties": { "key": { "deprecated": true, "warningMessage": { "deprecated": "This key is deprecated from `2026-01-01`" } ... } } }Additional context
VS Code already supports this.
microsoft/vscode-json-languageservice#226
This was brought up in the discussion below, but it wasn't the main topic, so it seems there hasn't been any progress.
#391