Skip to content

✨ Proposal: Support deprecationMessage #1716

Description

@ya7010

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalInitial discussion of a new idea. A project will be created once a proposal document is created.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions