Skip to content

Latest commit

 

History

History
98 lines (93 loc) · 2.13 KB

1040.md

File metadata and controls

98 lines (93 loc) · 2.13 KB

1040 - AddedReadOnlyPropertyInResponse

Description: Checks whether a readOnly property is added to the response model from the previous specification.

Cause: This is considered a change.

Example: Property c is being added into model Parameters from response direction.

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": {
        "a": {
          "type": "string",
          "description": "Required. Property a."
        },
        "b": {
          "type": "string",
          "description": "Required. Enum Property b.",
          "enum": [ "b1", "b2" ]
        }
      },
      "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/Parameters"
            }
          }
        }
      }
  }
  "definitions": {
    ...
    ...
    "Parameters": {
      "properties": {
        "a": {
          "type": "string",
          "description": "Required. Property a."
        },
        "b": {
          "type": "string",
          "description": "Required. Enum Property b.",
          "enum": [ "b1", "b2" ]
        },
        "c": {
          "type": "string",
          "readOnly": true,
          "description": "Read Only. Property c."
        }
      },
      "description": "The parameters used when get operation."
    },
    ...