Skip to content

Latest commit

 

History

History
74 lines (69 loc) · 1.61 KB

1021.md

File metadata and controls

74 lines (69 loc) · 1.61 KB

1021 - AddedAdditionalProperties

Description: Checks whether any property adds additionalProperties element from the previous specification.

Cause: This is considered a breaking change.

Example: Property a of Parameter CreateParameters adds additionalProperties element in the new version.

Old specification

{
  "swagger": "2.0",
  "info": {
    "title": "swagger",
    "description": "The Azure Management API.",
    "version": "2016-12-01",
    ...
    ...
  "definitions": {
    ...
    "CreateParameters": {
      "properties": {
        "a": {
          "type": "object",
          "description": "Property a."
        },
        "b": {
          "type": "string",
          "description": "Enum Property b.",
          "enum": [ "b1", "b2", "b3", "b4" ]
        }
      },
      "required": [
        "a"
      ],
      "description": "The parameters used when create operation."
    },
    ...  

New specification

{
  "swagger": "2.0",
  "info": {
    "title": "swagger",
    "description": "The Azure Management API.",
    "version": "2016-12-01",
    ...
    ...
  "definitions": {
    ...
    "CreateParameters": {
      "properties": {
        "a": {
          "type": "object",
          "description": "Property a.",
          "additionalProperties": {
            "type": "string"
          }
        },
        "b": {
          "type": "string",
          "description": "Enum Property b.",
          "enum": [ "b1", "b2", "b3", "b4" ]
        }
      },
      "required": [
        "a"
      ],
      "description": "The parameters used when create operation."
    },
    ...