Skip to content

How to deprecate properties #21425

Open
Open
@bingosummer

Description

@bingosummer

I want to mark the property foo deprecated. For example, ""

  "definitions": {
    "MyProperties": {
      "type": "object",
      "properties": {
        "foo": {
          "type": "string",
          "description": "I want to deprecate this field"
        }
    }
  }

I know we can set "deprecated": true for a path. But for the schema object, I didn't see the property deprecated in the official OpenAPI 2.0 doc https://spec.openapis.org/oas/v2.0#schema-object.

https://github.com/Azure/autorest/blob/main/Samples/test/deprecated/deprecated.yaml mentions "x-deprecated". But I didn't find any docs about it or any examples in azure-rest-api-specs.

Question:

  1. Is there a way to mark a property deprecate?
  2. If yes, after deprecated, what does it actually do? Can the user still use the property and get a warning?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions