{
  "openapi": "3.0.3",
  "info": {
    "title": "OpenAPI Breaking Change and Contract Release Gate",
    "version": "1.0.0",
    "description": "Deterministic OpenAPI 3.0 & 3.1 compatibility checks for API release pipelines. Submit two customer-owned JSON OpenAPI documents and receive a machine-readable PASS or FAIL gate."
  },
  "servers": [
    {
      "url": "https://api-contract-release-gate.vercel.app"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "Service is available."
          }
        }
      }
    },
    "/v1/compare": {
      "post": {
        "operationId": "compareContracts",
        "summary": "Compare two OpenAPI 3.0/3.1 contracts for breaking changes",
        "description": "Compares customer-supplied OpenAPI 3.0 or 3.1 JSON documents and returns a deterministic PASS or FAIL release gate with breaking-change diagnostics and SHA-256 contract hash.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["before", "after"],
                "properties": {
                  "before": {
                    "type": "object",
                    "description": "Baseline OpenAPI 3.0/3.1 JSON document."
                  },
                  "after": {
                    "type": "object",
                    "description": "Candidate OpenAPI 3.0/3.1 JSON document."
                  }
                }
              },
              "example": {
                "before": {
                  "openapi": "3.0.0",
                  "info": { "title": "Payments API", "version": "1.0.0" },
                  "paths": {
                    "/v1/charges": {
                      "post": { "responses": { "200": { "description": "OK" } } }
                    },
                    "/v1/refunds": {
                      "post": { "responses": { "200": { "description": "OK" } } }
                    }
                  }
                },
                "after": {
                  "openapi": "3.0.0",
                  "info": { "title": "Payments API", "version": "1.1.0" },
                  "paths": {
                    "/v1/charges": {
                      "post": { "responses": { "200": { "description": "OK" } } }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comparison completed with PASS/FAIL gate."
          }
        }
      }
    }
  }
}
