Skip to content

Latest commit

 

History

History
101 lines (96 loc) · 2.26 KB

1017.md

File metadata and controls

101 lines (96 loc) · 2.26 KB

1017 - ReferenceRedirection

Description: Checks whether any '$ref' property points to different models from the previous specification. note: if the model is flagged with 'x-ms-client-name', the 'x-ms-client-name' will override the reference name.

Cause: This is considered a breaking change.

Example: Schema of response 200 points to NewParameters in the new specification.

Old specification

{
  "swagger": "2.0",
  "info": {
    "title": "swagger",
    "description": "The Azure Management API.",
    "version": "2016-12-01",
    ...
    ...
  "paths:" {
    "/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/resource1": {
      "get": {
        ...
        "responses": {
          "200": {
            "schema": {
              "$ref": "#/definitions/Parameters"
            }
          }
        }
      }
  }
  "definitions": {
    ...
    ...
    "Parameters": {
      "properties": {
        "name": {
          "type": "string",
          "description": "Property name."
        },
        "type": {
          "type": "string",
          "description": "Enum Property type.",
          "enum": [ "Microsoft.Storage/storageAccounts" ],
          "required": true
        }
      },
      "description": "The parameters used when get operation."
    },
    ...  

New specification

{
  "swagger": "2.0",
  "info": {
    "title": "swagger",
    "description": "The Azure Management API.",
    "version": "2016-12-01",
    ...
    ...
  "paths:" {
    "/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/resource1": {
      "get": {
        ...
        "responses": {
          "200": {
            "schema": {
              "$ref": "#/definitions/NewParameters"
            }
          }
        }
      }
  }
  "definitions": {
    ...
    ...
    "Parameters": {
      "properties": {
        "name": {
          "type": "string",
          "description": "Property name."
        },
        "type": {
          "type": "string",
          "description": "Enum Property type.",
          "enum": [ "Microsoft.Storage/storageAccounts" ],
          "required": true
        }
      },
      "description": "The parameters used when get operation."
    },
    "NewParameters": {
      "properties": {
        ...
      }
    }
    ...