{
  "openapi": "3.1.1",
  "info": {
    "title": "OpenAPI Diff Explorer API",
    "version": "1.0.0",
    "summary": "Compare two versions of an OpenAPI spec and see exactly which changes break clients.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://openapidiffexplorer.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Compare two versions of an OpenAPI spec and see exactly which changes break clients.",
        "description": "Paste or link two OpenAPI 3.x (or Swagger 2) documents in JSON or YAML. Every operation, parameter, request body, response and schema property is compared (with $ref resolution), and each change is classified as breaking, potentially breaking or non-breaking, with the direction-aware rules API teams use (e.g. a new required request field breaks clients; a new response field does not; a new response enum value might).\n\nMethodology:\n- Operations are matched by method + path; paths that differ only in parameter names ({id} vs {orderId}) are treated as the same operation.\n- Request side (parameters, bodies): removing accepted values, adding required inputs, tightening limits or changing types is breaking.\n- Response side: removing properties or success responses, or making a guaranteed field optional, is breaking; new enum values, new nullability and new success codes are potentially breaking; additions are non-breaking.\n- Local $refs are resolved (cycles detected). Removed operations and changed security requirements are breaking.\n- Semver advice: any breaking change → major; additions only → minor; otherwise patch.",
        "tags": [
          "devcloud"
        ],
        "x-mcp-tool": "openapi_diff_explorer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenapiDiffExplorerInput"
              },
              "examples": {
                "example1": {
                  "summary": "Shop API v1 → v2",
                  "value": {
                    "oldSpec": "openapi: 3.0.3\ninfo:\n  title: Shop API\n  version: 1.0.0\npaths:\n  /orders:\n    get:\n      operationId: listOrders\n      parameters:\n        - name: limit\n          in: query\n          schema: {type: integer, maximum: 100}\n      responses:\n        '200':\n          description: ok\n          content:\n            application/json:\n              schema:\n                type: array\n                items: {$ref: '#/components/schemas/Order'}\n    post:\n      operationId: createOrder\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                sku: {type: string}\n                note: {type: string}\n              required: [sku]\n      responses:\n        '201': {description: created}\n  /orders/{id}:\n    delete:\n      operationId: deleteOrder\n      parameters:\n        - {name: id, in: path, required: true, schema: {type: string}}\n      responses:\n        '204': {description: deleted}\ncomponents:\n  schemas:\n    Order:\n      type: object\n      required: [id, status]\n      properties:\n        id: {type: string}\n        status: {type: string, enum: [open, shipped]}\n        total: {type: number}\n",
                    "newSpec": "openapi: 3.0.3\ninfo:\n  title: Shop API\n  version: 1.0.0\npaths:\n  /orders:\n    get:\n      operationId: listOrders\n      parameters:\n        - name: limit\n          in: query\n          schema: {type: integer, maximum: 50}\n      responses:\n        '200':\n          description: ok\n          content:\n            application/json:\n              schema:\n                type: array\n                items: {$ref: '#/components/schemas/Order'}\n    post:\n      operationId: createOrder\n      requestBody:\n        content:\n          application/json:\n            schema:\n              type: object\n              properties:\n                sku: {type: string}\n                quantity: {type: integer}\n              required: [sku, quantity]\n      responses:\n        '201': {description: created}\ncomponents:\n  schemas:\n    Order:\n      type: object\n      required: [id, status]\n      properties:\n        id: {type: string}\n        status: {type: string, enum: [open, shipped, cancelled]}\n"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenapiDiffExplorerResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "OpenapiDiffExplorerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "oldSpec": {
            "title": "Old spec (JSON or YAML)",
            "type": "string",
            "maxLength": 4000000
          },
          "newSpec": {
            "title": "New spec (JSON or YAML)",
            "type": "string",
            "maxLength": 4000000
          },
          "oldUrl": {
            "title": "Or: URL of the old spec",
            "type": "string",
            "format": "uri"
          },
          "newUrl": {
            "title": "Or: URL of the new spec",
            "type": "string",
            "format": "uri"
          }
        },
        "required": []
      },
      "OpenapiDiffExplorerResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "old",
              "new",
              "counts",
              "changes",
              "semverAdvice"
            ],
            "properties": {
              "old": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "title",
                  "version",
                  "operations"
                ],
                "properties": {
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "version": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "operations": {
                    "type": "integer"
                  }
                }
              },
              "new": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "title",
                  "version",
                  "operations"
                ],
                "properties": {
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "version": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "operations": {
                    "type": "integer"
                  }
                }
              },
              "counts": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "breaking",
                  "potentiallyBreaking",
                  "nonBreaking"
                ],
                "properties": {
                  "breaking": {
                    "type": "integer"
                  },
                  "potentiallyBreaking": {
                    "type": "integer"
                  },
                  "nonBreaking": {
                    "type": "integer"
                  }
                }
              },
              "semverAdvice": {
                "type": "string",
                "enum": [
                  "major",
                  "minor",
                  "patch"
                ]
              },
              "changes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "severity",
                    "location",
                    "change",
                    "detail"
                  ],
                  "properties": {
                    "severity": {
                      "type": "string",
                      "enum": [
                        "breaking",
                        "potentially-breaking",
                        "non-breaking"
                      ]
                    },
                    "location": {
                      "type": "string"
                    },
                    "change": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}