Skip to content

Latest commit

 

History

History
75 lines (70 loc) · 1.93 KB

1037.md

File metadata and controls

75 lines (70 loc) · 1.93 KB

1037 - ConstraintIsWeaker

Description: Checks whether any constraining in responses like maximum, minimum, minLength, maxLength etc. has been weaker from the previous specification.

Cause: This is considered a breaking change.

Example: Value of maxItems element of property a is changed from 4000 to 5000 in the new version.

Old specification

{
  "swagger": "2.0",
  "info": {
    "title": "swagger",
    "description": "The Azure Management API.",
    "version": "2016-12-01",
    ...
    ...
  "paths": {
    "/api/Responses": {
      "get": {
        ...
          "responses": {
            "200": {
              "schema": {
                "type": "object",
                "properties": {
                  "a": {
                    "type": "array",
                    "minItems": 11,
                    "maxItems": 4000,
                    "collectionFormat": "pipes",
                    "items": {
                      "type": "integer",
                      "minimum": 11,
                      "maximum": 21,
                      "multipleOf": 4
                    }
                  },
        ... 

New specification

{
  "swagger": "2.0",
  "info": {
    "title": "swagger",
    "description": "The Azure Management API.",
    "version": "2016-12-01",
    ...
    ...
  "paths": {
    "/api/Responses": {
      "get": {
        ...
          "responses": {
            "200": {
              "schema": {
                "type": "object",
                "properties": {
                  "a": {
                    "type": "array",
                    "minItems": 12,
                    "maxItems": 5000,
                    "collectionFormat": "pipes",
                    "items": {
                      "type": "integer",
                      "minimum": 11,
                      "maximum": 21,
                      "multipleOf": 4
                    }
                  },
        ...