{
  "openapi": "3.1.0",
  "info": {
    "title": "magento.watch API",
    "version": "1.0.0",
    "summary": "Magento Open Source, Adobe Commerce and Mage-OS version lifecycle data",
    "description": "Free, unauthenticated, CORS-open REST API returning release dates, end-of-life dates and system requirements for every tracked Magento Open Source, Adobe Commerce and Mage-OS release. No API key, no rate limit. Responses are cacheable (`Cache-Control: public, max-age=3600, s-maxage=86400`).",
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    },
    "contact": {
      "name": "magento.watch",
      "url": "https://magento.watch/api"
    }
  },
  "servers": [
    {
      "url": "https://magento.watch",
      "description": "Production"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "versions",
      "description": "Version lifecycle lookups"
    },
    {
      "name": "security",
      "description": "Security bulletin lookups"
    },
    {
      "name": "patches",
      "description": "Adobe Quality Patches Tool patches with resolved applicability"
    },
    {
      "name": "upstream-fixes",
      "description": "Community fixes merged upstream, not yet in a release line; not Adobe Quality Patches"
    },
    {
      "name": "meta",
      "description": "Service metadata"
    }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Service health",
        "description": "Returns service status, current server time and the distributions this deployment knows about.",
        "tags": [
          "meta"
        ],
        "responses": {
          "200": {
            "description": "Service is healthy",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{distribution}/versions": {
      "get": {
        "operationId": "getVersions",
        "summary": "All tracked releases",
        "description": "Every release recorded for the distribution, each enriched with lifecycle flags computed against the current date and a `securitySummary` with the Adobe security patches the release still needs.",
        "tags": [
          "versions"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "path",
            "required": true,
            "description": "Magento distribution slug",
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            },
            "example": "magento-community"
          }
        ],
        "responses": {
          "200": {
            "description": "All tracked releases",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown distribution slug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{distribution}/versions/supported": {
      "get": {
        "operationId": "getSupportedVersions",
        "summary": "Supported releases",
        "description": "Releases where `isEOLVersion` is false and `isFutureVersion` is false.",
        "tags": [
          "versions"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "path",
            "required": true,
            "description": "Magento distribution slug",
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            },
            "example": "magento-community"
          }
        ],
        "responses": {
          "200": {
            "description": "Supported releases",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown distribution slug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{distribution}/versions/secure": {
      "get": {
        "operationId": "getSecureVersions",
        "summary": "Releases inside their support window",
        "description": "Releases where `isSecureVersion` is true and `isFutureVersion` is false. Despite the path, this is the support lifecycle: a release listed here can still have open security bulletins. Read `securitySummary` on each item, or `/versions/{version}/security` for the remedies.",
        "tags": [
          "versions"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "path",
            "required": true,
            "description": "Magento distribution slug",
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            },
            "example": "magento-community"
          }
        ],
        "responses": {
          "200": {
            "description": "Releases inside their support window",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown distribution slug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{distribution}/versions/latest": {
      "get": {
        "operationId": "getLatestVersion",
        "summary": "Latest release",
        "description": "The single release flagged `isLatestVersion`. `data` still uses the version string as its key.",
        "tags": [
          "versions"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "path",
            "required": true,
            "description": "Magento distribution slug",
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            },
            "example": "magento-community"
          }
        ],
        "responses": {
          "200": {
            "description": "Latest release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown distribution slug",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/security-bulletins": {
      "get": {
        "operationId": "getSecurityBulletins",
        "summary": "All security bulletins",
        "description": "Adobe security bulletins with CVE and fixed-in mapping, keyed by bulletin id. Optionally filtered by `severity` or `since`.",
        "tags": [
          "security"
        ],
        "parameters": [
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "description": "Filter to one severity",
            "schema": {
              "type": "string",
              "enum": [
                "critical",
                "important",
                "moderate"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Filter to bulletins published on or after this date",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2025-01-01"
          }
        ],
        "responses": {
          "200": {
            "description": "All matching bulletins",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityBulletinsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/security-bulletins/{id}": {
      "get": {
        "operationId": "getSecurityBulletin",
        "summary": "One security bulletin by id",
        "description": "Exact lookup by bulletin id, e.g. `APSB24-40`.",
        "tags": [
          "security"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Adobe security bulletin id",
            "schema": {
              "type": "string"
            },
            "example": "APSB24-40"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested bulletin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurityBulletinResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown bulletin id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/patches/search": {
      "get": {
        "operationId": "getPatchSearch",
        "summary": "Search quality patches for a version",
        "tags": [
          "patches"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            }
          },
          {
            "name": "version",
            "example": "2.4.7-p5",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "example": "admin sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "modules",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "description": "Repeated or comma-separated component names; boosts ranking"
          },
          {
            "name": "categories",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "description": "Repeated or comma-separated QPT categories; boosts ranking"
          },
          {
            "name": "includeInapplicable",
            "description": "Accepts true/1 or false/0 (case-insensitive); defaults to false",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search quality patches for a version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatchSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid search input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/patches/{id}/composer.zip": {
      "get": {
        "operationId": "getPatchComposerBundle",
        "summary": "Download a composer-patches bundle",
        "tags": [
          "patches"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "ACSD-56760"
          },
          {
            "name": "version",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2.4.6-p8",
            "description": "Exact compatible version; all applicable non-deprecated source files are combined."
          },
          {
            "name": "distribution",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce"
              ]
            },
            "description": "Distribution to select all applicable source files."
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Current QPT commit prefix (first 12 characters) enables immutable caching; absent or stale values use the regular cache policy."
          },
          {
            "name": "tests",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "with",
                "without"
              ],
              "default": "with"
            },
            "description": "Include or omit test files."
          }
        ],
        "responses": {
          "200": {
            "description": "ZIP with README, Composer snippet and package-relative patch files",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Missing version or missing/invalid distribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown patch or inapplicable version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream patch unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/patches/{id}/composer/{vendor}/{file}": {
      "get": {
        "operationId": "getPatchComposerFile",
        "summary": "Download one package-relative patch file",
        "tags": [
          "patches"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "ACSD-56760"
          },
          {
            "name": "vendor",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "magento"
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "module-admin-gws.patch"
          },
          {
            "name": "version",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2.4.6-p8",
            "description": "Exact compatible version; all applicable non-deprecated source files are combined."
          },
          {
            "name": "distribution",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce"
              ]
            },
            "description": "Distribution to select all applicable source files."
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Current QPT commit prefix (first 12 characters) enables immutable caching; absent or stale values use the regular cache policy."
          },
          {
            "name": "tests",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "with",
                "without"
              ],
              "default": "with"
            },
            "description": "Include or omit test files."
          }
        ],
        "responses": {
          "200": {
            "description": "Patch with paths relative to the Composer package root",
            "content": {
              "text/x-diff": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Missing version or missing/invalid distribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown patch, inapplicable version or missing package file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream patch unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/patches/{id}": {
      "get": {
        "operationId": "getPatch",
        "summary": "One quality patch by id",
        "tags": [
          "patches"
        ],
        "parameters": [
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Include install instructions for this version; requires distribution. Composer is null when no live files apply."
          },
          {
            "name": "distribution",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce"
              ]
            },
            "description": "Required when version is given."
          },
          {
            "name": "id",
            "example": "ACSD-56760",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One quality patch by id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid distribution when version is given",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown patch id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/patches": {
      "get": {
        "operationId": "getPatches",
        "summary": "All quality patches keyed by id",
        "tags": [
          "patches"
        ],
        "responses": {
          "200": {
            "description": "All quality patches keyed by id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatchesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{distribution}/versions/{version}/patches": {
      "get": {
        "operationId": "getVersionPatches",
        "summary": "All quality patches applicable to a version",
        "tags": [
          "patches"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "path",
            "required": true,
            "description": "Magento distribution slug",
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            },
            "example": "magento-community"
          },
          {
            "name": "version",
            "example": "2.4.7-p5",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All quality patches applicable to a version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatchSearchResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown distribution or version absent from its data file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{distribution}/versions/{version}/security": {
      "get": {
        "operationId": "getVersionSecurity",
        "summary": "Security status for one release",
        "description": "Which security bulletins affect this version, which patch fixes each one, and the recommended version in the same release line.",
        "tags": [
          "security"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "path",
            "required": true,
            "description": "Magento distribution slug",
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            },
            "example": "magento-community"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "Exact version key, including any patch suffix",
            "schema": {
              "type": "string"
            },
            "example": "2.4.7"
          }
        ],
        "responses": {
          "200": {
            "description": "Security status for the requested release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionSecurityResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown distribution slug or unknown version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{distribution}/versions/{version}": {
      "get": {
        "operationId": "getVersion",
        "summary": "One release by version string",
        "description": "Exact lookup by version key. Unlike the list endpoints, `data` holds the version object directly rather than a keyed map, and embeds a derived `security` summary (same shape as `/security` minus `distribution` and `version`).",
        "tags": [
          "versions"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "path",
            "required": true,
            "description": "Magento distribution slug",
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            },
            "example": "magento-community"
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "Exact version key, including any patch suffix",
            "schema": {
              "type": "string"
            },
            "example": "2.4.7-p3"
          }
        ],
        "responses": {
          "200": {
            "description": "The requested release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown distribution slug or unknown version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{distribution}/versions/{version}/upstream-fixes": {
      "get": {
        "operationId": "getVersionUpstreamFixes",
        "summary": "All upstream fixes applicable to a version",
        "description": "Community fixes merged upstream whose `affectedVersions` include this release, sorted by `pr.mergedAt` descending. Mage-OS returns `status: \"unknown\"` until its tags are checked separately.",
        "tags": [
          "upstream-fixes"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "path",
            "required": true,
            "description": "Magento distribution slug",
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            },
            "example": "magento-community"
          },
          {
            "name": "version",
            "example": "2.4.7-p5",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "All upstream fixes applicable to a version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpstreamFixSearchResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown distribution or version absent from its data file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/upstream-fixes/search": {
      "get": {
        "operationId": "getUpstreamFixSearch",
        "summary": "Search upstream fixes for a version",
        "tags": [
          "upstream-fixes"
        ],
        "parameters": [
          {
            "name": "distribution",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            }
          },
          {
            "name": "version",
            "example": "2.4.7-p5",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "example": "catalog price index",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "modules",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "description": "Repeated or comma-separated component names; boosts ranking"
          },
          {
            "name": "categories",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "style": "form",
            "explode": true,
            "description": "Repeated or comma-separated QPT category names; boosts ranking"
          },
          {
            "name": "fixedIn",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Restrict to fixes whose `fixedIn` is this release"
          },
          {
            "name": "includeExcluded",
            "description": "Accepts true/1 or false/0 (case-insensitive); defaults to false",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search upstream fixes for a version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpstreamFixSearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid search input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/upstream-fixes/{id}/composer.zip": {
      "get": {
        "operationId": "getUpstreamFixComposerBundle",
        "summary": "Download a composer-patches bundle for an upstream fix",
        "tags": [
          "upstream-fixes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "magento2-40867"
          },
          {
            "name": "version",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2.4.7-p5",
            "description": "Exact version the fix applies to; the merge commit diff is stripped and split per package."
          },
          {
            "name": "distribution",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce"
              ]
            }
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "First 12 characters of `pr.headCommit` enables immutable caching; absent or stale values use the regular cache policy."
          },
          {
            "name": "includeUnmatched",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Accepts true/1 or false/0 (case-insensitive); returns a fix for a version outside `affectedVersions` when true."
          }
        ],
        "responses": {
          "200": {
            "description": "ZIP with README, Composer snippet and package-relative patch files",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Missing version or missing/invalid distribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown fix or version outside affected versions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream diff unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/upstream-fixes/{id}/composer/{vendor}/{file}": {
      "get": {
        "operationId": "getUpstreamFixComposerFile",
        "summary": "Download one package-relative upstream fix file",
        "tags": [
          "upstream-fixes"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "magento2-40867"
          },
          {
            "name": "vendor",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "magento"
          },
          {
            "name": "file",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "module-catalog.patch"
          },
          {
            "name": "version",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2.4.7-p5",
            "description": "Exact version the fix applies to; the merge commit diff is stripped and split per package."
          },
          {
            "name": "distribution",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce"
              ]
            }
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "First 12 characters of `pr.headCommit` enables immutable caching; absent or stale values use the regular cache policy."
          },
          {
            "name": "includeUnmatched",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Accepts true/1 or false/0 (case-insensitive); returns a fix for a version outside `affectedVersions` when true."
          }
        ],
        "responses": {
          "200": {
            "description": "Patch with paths relative to the Composer package root",
            "content": {
              "text/x-diff": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Missing version or missing/invalid distribution",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown fix, unmatched version or missing package file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream diff unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/upstream-fixes/{id}": {
      "get": {
        "operationId": "getUpstreamFix",
        "summary": "One upstream fix by id",
        "tags": [
          "upstream-fixes"
        ],
        "parameters": [
          {
            "name": "id",
            "example": "magento2-40867",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One upstream fix by id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpstreamFixResponse"
                }
              }
            }
          },
          "404": {
            "description": "Unknown fix id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/upstream-fixes": {
      "get": {
        "operationId": "getUpstreamFixes",
        "summary": "All upstream fixes keyed by id",
        "description": "Community bug fixes merged into `magento/magento2` since 2022-01-01, with tag ancestry, code matching and Composer delivery. Excluded entries remain in the file.",
        "tags": [
          "upstream-fixes"
        ],
        "responses": {
          "200": {
            "description": "All upstream fixes keyed by id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpstreamFixesResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "UpstreamFixSource": {
        "type": "string",
        "enum": [
          "github-pr"
        ]
      },
      "CodeMatch": {
        "type": "string",
        "enum": [
          "clean",
          "conflict",
          "file-missing",
          "error"
        ]
      },
      "IssueKind": {
        "type": "string",
        "enum": [
          "human",
          "pr-derived"
        ]
      },
      "UpstreamFixExclusion": {
        "type": "string",
        "description": "Why the entry is left out of default lists and search. `not-bugfix`: no linked issue is confirmed and Clef triage does not classify the change as a bug fix.",
        "enum": [
          "test-only-or-non-code",
          "change-kind",
          "feature-request-label",
          "not-bugfix"
        ]
      },
      "UpstreamFixPr": {
        "type": "object",
        "required": [
          "number",
          "url",
          "author",
          "mergedAt",
          "mergeCommit",
          "headCommit",
          "baseRef",
          "diffSha256"
        ],
        "properties": {
          "number": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "author": {
            "type": "string"
          },
          "mergedAt": {
            "type": "string",
            "format": "date-time"
          },
          "mergeCommit": {
            "type": "string"
          },
          "headCommit": {
            "type": "string"
          },
          "baseRef": {
            "type": "string"
          },
          "diffSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "description": "SHA-256 of the pull request diff (`pull/{number}.diff`) the dataset was built from; delivery refuses a diff that no longer hashes to it."
          }
        }
      },
      "UpstreamFixIssue": {
        "type": "object",
        "required": [
          "number",
          "url",
          "title",
          "labels",
          "kind"
        ],
        "properties": {
          "number": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "kind": {
            "$ref": "#/components/schemas/IssueKind"
          }
        }
      },
      "UpstreamFixLabels": {
        "type": "object",
        "required": [
          "area",
          "component",
          "priority",
          "severity",
          "reportedOn"
        ],
        "properties": {
          "area": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "component": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "priority": {
            "type": [
              "string",
              "null"
            ]
          },
          "severity": {
            "type": [
              "string",
              "null"
            ]
          },
          "reportedOn": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UpstreamFixFile": {
        "type": "object",
        "required": [
          "path",
          "change",
          "package"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "change": {
            "type": "string",
            "enum": [
              "modified",
              "added",
              "deleted",
              "renamed"
            ]
          },
          "package": {
            "type": "string"
          },
          "from": {
            "type": "string"
          }
        }
      },
      "UpstreamFixStripped": {
        "type": "object",
        "required": [
          "tests",
          "docs",
          "outsideCode"
        ],
        "properties": {
          "tests": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "docs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "outsideCode": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UpstreamFixSections": {
        "type": "object",
        "required": [
          "description",
          "stepsToReproduce",
          "expectedResult",
          "actualResult",
          "source"
        ],
        "properties": {
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "stepsToReproduce": {
            "type": [
              "string",
              "null"
            ]
          },
          "expectedResult": {
            "type": [
              "string",
              "null"
            ]
          },
          "actualResult": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "issue",
              "pr",
              null
            ]
          }
        }
      },
      "ClefChoice": {
        "type": "object",
        "required": [
          "choice",
          "probabilities",
          "confidence"
        ],
        "properties": {
          "choice": {
            "type": "string"
          },
          "probabilities": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "confidence": {
            "type": "number"
          }
        }
      },
      "ClefScore": {
        "type": "object",
        "required": [
          "score",
          "probabilities",
          "confidence"
        ],
        "properties": {
          "score": {
            "type": "number"
          },
          "probabilities": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "confidence": {
            "type": "number"
          }
        }
      },
      "UpstreamFixTriage": {
        "type": "object",
        "required": [
          "model",
          "requestHash",
          "isBugfix",
          "changeKind",
          "scope",
          "risk",
          "area",
          "securityRelevant",
          "reportedVersion",
          "backportWorthy"
        ],
        "properties": {
          "model": {
            "type": "string"
          },
          "requestHash": {
            "type": "string"
          },
          "isBugfix": {
            "type": "number"
          },
          "changeKind": {
            "$ref": "#/components/schemas/ClefChoice"
          },
          "scope": {
            "$ref": "#/components/schemas/ClefScore"
          },
          "risk": {
            "$ref": "#/components/schemas/ClefScore"
          },
          "area": {
            "$ref": "#/components/schemas/ClefChoice"
          },
          "securityRelevant": {
            "type": "number"
          },
          "reportedVersion": {
            "$ref": "#/components/schemas/ClefChoice"
          },
          "backportWorthy": {
            "$ref": "#/components/schemas/ClefScore"
          }
        }
      },
      "UpstreamFixCurated": {
        "type": "object",
        "required": [
          "title",
          "description",
          "categories",
          "author",
          "date",
          "reviewedBy"
        ],
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "author": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "reviewedBy": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "UpstreamFixTests": {
        "type": "object",
        "description": "fail to pass: fails before, passes after. not-runnable to pass: test could not run before the patch, passes after (the test references code the patch adds, or its file did not apply to this release). not-runnable to error: test files do not apply to this release. pass to pass: passes before and after (test does not cover the fix), a warning. Other passing before or non-passing after outcomes are warnings retaining the after value. adapted adds (test header adapted).",
        "required": [
          "before",
          "after",
          "adapted",
          "runAt",
          "releaseCommit"
        ],
        "properties": {
          "suites": {
            "type": "object",
            "description": "Per-suite outcomes underlying the aggregate runtime result.",
            "additionalProperties": false,
            "properties": {
              "unit": {
                "type": "object",
                "required": [
                  "before",
                  "after"
                ],
                "properties": {
                  "before": {
                    "type": "string",
                    "enum": [
                      "fail",
                      "pass",
                      "not-runnable"
                    ]
                  },
                  "after": {
                    "type": "string",
                    "enum": [
                      "pass",
                      "fail",
                      "error"
                    ]
                  }
                }
              },
              "integration": {
                "type": "object",
                "required": [
                  "before",
                  "after"
                ],
                "properties": {
                  "before": {
                    "type": "string",
                    "enum": [
                      "fail",
                      "pass",
                      "not-runnable"
                    ]
                  },
                  "after": {
                    "type": "string",
                    "enum": [
                      "pass",
                      "fail",
                      "error"
                    ]
                  }
                }
              },
              "api-functional": {
                "type": "object",
                "required": [
                  "before",
                  "after"
                ],
                "properties": {
                  "before": {
                    "type": "string",
                    "enum": [
                      "fail",
                      "pass",
                      "not-runnable"
                    ]
                  },
                  "after": {
                    "type": "string",
                    "enum": [
                      "pass",
                      "fail",
                      "error"
                    ]
                  }
                }
              }
            }
          },
          "before": {
            "type": "string",
            "enum": [
              "fail",
              "pass",
              "not-runnable"
            ]
          },
          "after": {
            "type": "string",
            "enum": [
              "pass",
              "fail",
              "error"
            ],
            "description": "error means the code patch did not apply or the suite could not run after it."
          },
          "adapted": {
            "type": "boolean"
          },
          "runAt": {
            "type": "string",
            "format": "date-time",
            "description": "RFC 3339 timestamp; fractional seconds and numeric offsets or Z are accepted. Stored as UTC Z with millisecond precision."
          },
          "releaseCommit": {
            "type": "string"
          }
        }
      },
      "UpstreamFix": {
        "type": "object",
        "required": [
          "id",
          "source",
          "sourceRef",
          "title",
          "pr",
          "issues",
          "fixedIn",
          "containingTags",
          "reportedOn",
          "codeMatch",
          "affectedVersions",
          "components",
          "files",
          "stripped",
          "linesChanged",
          "mergeBatched",
          "excluded",
          "sections",
          "signatures",
          "labels",
          "categories",
          "triage",
          "curated",
          "tests"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "magento2-40867"
          },
          "source": {
            "$ref": "#/components/schemas/UpstreamFixSource"
          },
          "sourceRef": {
            "type": "string",
            "example": "magento/magento2#40867"
          },
          "title": {
            "type": "string"
          },
          "pr": {
            "$ref": "#/components/schemas/UpstreamFixPr"
          },
          "issues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpstreamFixIssue"
            }
          },
          "fixedIn": {
            "type": [
              "string",
              "null"
            ],
            "example": "2.4.8-p1"
          },
          "containingTags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "reportedOn": {
            "type": [
              "string",
              "null"
            ],
            "example": "2.4.6-p6"
          },
          "codeMatch": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/CodeMatch"
            }
          },
          "affectedVersions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "components": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpstreamFixFile"
            }
          },
          "stripped": {
            "$ref": "#/components/schemas/UpstreamFixStripped"
          },
          "linesChanged": {
            "type": "integer"
          },
          "mergeBatched": {
            "type": "boolean"
          },
          "excluded": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpstreamFixExclusion"
              },
              {
                "type": "null"
              }
            ]
          },
          "sections": {
            "$ref": "#/components/schemas/UpstreamFixSections"
          },
          "signatures": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "labels": {
            "$ref": "#/components/schemas/UpstreamFixLabels"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "triage": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpstreamFixTriage"
              },
              {
                "type": "null"
              }
            ]
          },
          "curated": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpstreamFixCurated"
              },
              {
                "type": "null"
              }
            ]
          },
          "tests": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": {
                  "$ref": "#/components/schemas/UpstreamFixTests"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "UpstreamFixesMeta": {
        "type": "object",
        "required": [
          "magento2",
          "since",
          "tags",
          "knownVersions",
          "generatedAt",
          "generator",
          "maintainers",
          "counts"
        ],
        "properties": {
          "magento2": {
            "type": "object",
            "required": [
              "commit",
              "sweptAt"
            ],
            "properties": {
              "commit": {
                "type": "string"
              },
              "sweptAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "since": {
            "type": "string",
            "format": "date"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "commit"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "commit": {
                  "type": "string"
                }
              }
            }
          },
          "knownVersions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "generatedAt": {
            "type": "string",
            "format": "date"
          },
          "generator": {
            "type": "string"
          },
          "maintainers": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "github"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "github": {
                  "type": "string"
                }
              }
            }
          },
          "counts": {
            "type": "object",
            "required": [
              "entries",
              "excluded",
              "byFixedIn",
              "byCodeMatch"
            ],
            "properties": {
              "entries": {
                "type": "integer"
              },
              "excluded": {
                "type": "integer"
              },
              "byFixedIn": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "byCodeMatch": {
                "type": "object",
                "required": [
                  "clean",
                  "conflict",
                  "file-missing",
                  "error"
                ],
                "properties": {
                  "clean": {
                    "type": "integer"
                  },
                  "conflict": {
                    "type": "integer"
                  },
                  "file-missing": {
                    "type": "integer"
                  },
                  "error": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        }
      },
      "UpstreamFixesResponse": {
        "type": "object",
        "required": [
          "data",
          "_meta",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/UpstreamFix"
            }
          },
          "_meta": {
            "$ref": "#/components/schemas/UpstreamFixesMeta"
          },
          "_documentation": {
            "type": "string",
            "format": "uri"
          },
          "_description": {
            "type": "string"
          }
        }
      },
      "UpstreamFixResponse": {
        "type": "object",
        "required": [
          "data",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/UpstreamFix"
          },
          "_documentation": {
            "type": "string",
            "format": "uri"
          },
          "_description": {
            "type": "string"
          }
        }
      },
      "UpstreamFixInstall": {
        "type": "object",
        "required": [
          "composer"
        ],
        "properties": {
          "composer": {
            "type": "object",
            "required": [
              "zipUrl"
            ],
            "properties": {
              "zipUrl": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "UpstreamFixHit": {
        "type": "object",
        "required": [
          "id",
          "title",
          "prUrl",
          "issueUrls",
          "fixedIn",
          "reportedOn",
          "codeMatch",
          "tests",
          "affectedVersions",
          "components",
          "categories",
          "labels",
          "issueKind",
          "excluded",
          "install"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "score": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "prUrl": {
            "type": "string",
            "format": "uri"
          },
          "issueUrls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "fixedIn": {
            "type": [
              "string",
              "null"
            ]
          },
          "reportedOn": {
            "type": [
              "string",
              "null"
            ]
          },
          "codeMatch": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CodeMatch"
              },
              {
                "type": "null"
              }
            ]
          },
          "tests": {
            "description": "Runtime test evidence for the requested version; null when no result is recorded. Passing tests are not a safety claim.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpstreamFixTests"
              },
              {
                "type": "null"
              }
            ]
          },
          "affectedVersions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "components": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "labels": {
            "$ref": "#/components/schemas/UpstreamFixLabels"
          },
          "issueKind": {
            "$ref": "#/components/schemas/IssueKind"
          },
          "excluded": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/UpstreamFixExclusion"
              },
              {
                "type": "null"
              }
            ]
          },
          "triage": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "changeKind",
                  "risk",
                  "backportWorthy"
                ],
                "properties": {
                  "changeKind": {
                    "type": "string"
                  },
                  "risk": {
                    "type": "number"
                  },
                  "backportWorthy": {
                    "type": "number"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "install": {
            "$ref": "#/components/schemas/UpstreamFixInstall"
          },
          "matchedOn": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "FindUpstreamFixResult": {
        "type": "object",
        "required": [
          "status",
          "mode",
          "distribution",
          "version",
          "hits",
          "coverage"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "unknown",
              "unknown-version"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "list",
              "ranked"
            ]
          },
          "distribution": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "hits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpstreamFixHit"
            }
          },
          "knownVersions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "coverage": {
            "type": "object",
            "required": [
              "magento2Commit",
              "tags",
              "entries",
              "excluded"
            ],
            "properties": {
              "magento2Commit": {
                "type": "string"
              },
              "tags": {
                "type": "integer"
              },
              "entries": {
                "type": "integer"
              },
              "excluded": {
                "type": "integer"
              }
            }
          }
        }
      },
      "UpstreamFixSearchResponse": {
        "type": "object",
        "required": [
          "data",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/FindUpstreamFixResult"
          },
          "_documentation": {
            "type": "string",
            "format": "uri"
          },
          "_description": {
            "type": "string"
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "What was wrong with the request"
          }
        }
      },
      "PatchModifiedFile": {
        "type": "object",
        "required": [
          "path",
          "change",
          "package"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "change": {
            "type": "string",
            "enum": [
              "modified",
              "added",
              "deleted",
              "renamed"
            ]
          },
          "package": {
            "type": "string"
          },
          "from": {
            "type": "string"
          }
        }
      },
      "PatchFile": {
        "type": "object",
        "required": [
          "package",
          "constraint",
          "path",
          "blobSha",
          "url",
          "thirdParty",
          "modifies",
          "packages",
          "hasTests",
          "unknownVersions",
          "applicableVersions",
          "requires",
          "replacedWith",
          "deprecated"
        ],
        "properties": {
          "package": {
            "type": "string"
          },
          "constraint": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "blobSha": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "thirdParty": {
            "type": "boolean"
          },
          "modifies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatchModifiedFile"
            }
          },
          "packages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "hasTests": {
            "type": "boolean"
          },
          "unknownVersions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "applicableVersions": {
            "type": "object",
            "required": [
              "magento-community",
              "magento-commerce",
              "mage-os"
            ],
            "properties": {
              "magento-community": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "magento-commerce": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "mage-os": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "requires": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "replacedWith": {
            "type": [
              "string",
              "null"
            ]
          },
          "deprecated": {
            "type": "boolean"
          }
        }
      },
      "PatchDocumentation": {
        "type": "object",
        "required": [
          "url",
          "path",
          "blobSha",
          "description",
          "stepsToReproduce",
          "introducedInQpt",
          "createdFor",
          "documentedRange",
          "scheduledFixRelease"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "path": {
            "type": "string"
          },
          "blobSha": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "stepsToReproduce": {
            "type": [
              "string",
              "null"
            ]
          },
          "introducedInQpt": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdFor": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "documentedRange": {
            "type": [
              "string",
              "null"
            ]
          },
          "scheduledFixRelease": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Patch": {
        "type": "object",
        "required": [
          "id",
          "source",
          "sourceRef",
          "title",
          "categories",
          "components",
          "origin",
          "documentation",
          "files",
          "applicableVersions",
          "conditions",
          "requirements"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "qpt"
            ]
          },
          "sourceRef": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "components": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "origin": {
            "type": "string",
            "enum": [
              "adobe-commerce-support",
              "magento-os-community"
            ]
          },
          "documentation": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PatchDocumentation"
              },
              {
                "type": "null"
              }
            ]
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatchFile"
            }
          },
          "applicableVersions": {
            "type": "object",
            "required": [
              "magento-community",
              "magento-commerce",
              "mage-os"
            ],
            "properties": {
              "magento-community": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "magento-commerce": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "mage-os": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "conditions": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "and"
                ],
                "properties": {
                  "and": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "path",
                        "match"
                      ],
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        },
                        "match": {
                          "type": [
                            "string",
                            "number"
                          ]
                        }
                      }
                    }
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "or"
                ],
                "properties": {
                  "or": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "path",
                        "match"
                      ],
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        },
                        "match": {
                          "type": [
                            "string",
                            "number"
                          ]
                        }
                      }
                    }
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "requirements": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PatchHitFile": {
        "type": "object",
        "required": [
          "package",
          "constraint",
          "url",
          "modifies",
          "modifiesTruncated",
          "requires",
          "replacedWith",
          "deprecated"
        ],
        "properties": {
          "package": {
            "type": "string"
          },
          "constraint": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "modifies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "modifiesTruncated": {
            "type": "boolean"
          },
          "requires": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "replacedWith": {
            "type": [
              "string",
              "null"
            ]
          },
          "deprecated": {
            "type": "boolean"
          }
        }
      },
      "PatchHit": {
        "type": "object",
        "required": [
          "id",
          "applicable",
          "deprecated",
          "title",
          "categories",
          "components",
          "documentationUrl",
          "files",
          "requirements",
          "matchedOn"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "score": {
            "type": "integer"
          },
          "install": {
            "type": "object",
            "required": [
              "qpt",
              "composer"
            ],
            "properties": {
              "qpt": {
                "type": "object",
                "required": [
                  "command",
                  "cloud",
                  "requires"
                ],
                "properties": {
                  "command": {
                    "type": "string"
                  },
                  "cloud": {
                    "type": "string"
                  },
                  "requires": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "composer": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "zipUrl",
                      "packages",
                      "hasTests"
                    ],
                    "properties": {
                      "zipUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "packages": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "hasTests": {
                        "type": "boolean"
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "applicable": {
            "type": "boolean"
          },
          "deprecated": {
            "type": "boolean"
          },
          "title": {
            "type": "string"
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "components": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "documentationUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatchHitFile"
            }
          },
          "requirements": {
            "type": [
              "string",
              "null"
            ]
          },
          "matchedOn": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "FindPatchResult": {
        "type": "object",
        "required": [
          "status",
          "mode",
          "distribution",
          "version",
          "hits",
          "coverage"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "unknown",
              "unknown-version"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "list",
              "ranked"
            ]
          },
          "distribution": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "hits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PatchHit"
            }
          },
          "knownVersions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "coverage": {
            "type": "object",
            "required": [
              "qptTag",
              "docsCommit",
              "patchCount"
            ],
            "properties": {
              "qptTag": {
                "type": "string"
              },
              "docsCommit": {
                "type": "string"
              },
              "patchCount": {
                "type": "integer"
              }
            }
          }
        }
      },
      "PatchesResponse": {
        "type": "object",
        "required": [
          "data",
          "_meta",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/Patch"
            }
          },
          "_meta": {
            "type": "object",
            "required": [
              "qpt",
              "docs",
              "generator",
              "generatedAt",
              "knownVersions",
              "categories",
              "externalPrerequisites"
            ],
            "properties": {
              "qpt": {
                "type": "object",
                "required": [
                  "tag",
                  "commit"
                ],
                "properties": {
                  "tag": {
                    "type": "string"
                  },
                  "commit": {
                    "type": "string"
                  }
                }
              },
              "docs": {
                "type": "object",
                "required": [
                  "commit"
                ],
                "properties": {
                  "commit": {
                    "type": "string"
                  }
                }
              },
              "generator": {
                "type": "string"
              },
              "generatedAt": {
                "type": "string",
                "format": "date"
              },
              "knownVersions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "categories": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "externalPrerequisites": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "_documentation": {
            "type": "string",
            "format": "uri"
          },
          "_description": {
            "type": "string"
          }
        }
      },
      "PatchResponse": {
        "type": "object",
        "required": [
          "data",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Patch"
          },
          "_documentation": {
            "type": "string",
            "format": "uri"
          },
          "_description": {
            "type": "string"
          }
        }
      },
      "PatchSearchResponse": {
        "type": "object",
        "required": [
          "data",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/FindPatchResult"
          },
          "_documentation": {
            "type": "string",
            "format": "uri"
          },
          "_description": {
            "type": "string"
          }
        }
      },
      "SystemRequirements": {
        "type": "object",
        "description": "Map of kebab-case service key (`php`, `mysql`, `aws-aurora-mysql`, …) to the supported versions of that service. Fully populated per release — never inherited from a parent version.",
        "additionalProperties": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "examples": [
          {
            "php": [
              "8.3",
              "8.4"
            ],
            "mysql": [
              "8.0"
            ],
            "aws-s3": [
              "supported"
            ]
          }
        ]
      },
      "MagentoVersion": {
        "type": "object",
        "required": [
          "version",
          "releaseDate",
          "eolDate",
          "systemRequirements",
          "isEOLVersion",
          "isSecureVersion",
          "isLatestVersion",
          "isFutureVersion",
          "statusLabel"
        ],
        "properties": {
          "version": {
            "type": "string",
            "description": "Matches the key this object is stored under",
            "example": "2.4.7-p3"
          },
          "releaseDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "example": "2024-10-08"
          },
          "eolDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "example": "2027-11-01"
          },
          "systemRequirements": {
            "$ref": "#/components/schemas/SystemRequirements"
          },
          "isEOLVersion": {
            "type": "boolean",
            "description": "eolDate is in the past"
          },
          "isSecureVersion": {
            "type": "boolean",
            "description": "Neither EOL nor future-dated, so Adobe still ships security fixes for the line. Lifecycle only: it does not mean the release has no open security bulletins; see `securitySummary` or `security`."
          },
          "isLatestVersion": {
            "type": "boolean",
            "description": "True for exactly one release per distribution"
          },
          "isFutureVersion": {
            "type": "boolean",
            "description": "releaseDate is in the future, or the version is an alpha, beta or RC pre-release"
          },
          "statusLabel": {
            "type": "string",
            "enum": [
              "pre-release",
              "upcoming",
              "supported (latest)",
              "supported",
              "security-only",
              "eol",
              "unknown"
            ]
          }
        }
      },
      "VersionsResponse": {
        "type": "object",
        "required": [
          "data",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "type": "object",
            "description": "Version string to release object",
            "additionalProperties": {
              "$ref": "#/components/schemas/MagentoVersionListItem"
            }
          },
          "_documentation": {
            "type": "string",
            "format": "uri",
            "example": "https://magento.watch/api"
          },
          "_description": {
            "type": "string",
            "example": "Currently supported versions receiving active maintenance"
          }
        }
      },
      "ListSecuritySummary": {
        "type": "object",
        "description": "Security status of a release in list responses. Remedies live on `/versions/{version}/security`.",
        "required": [
          "status",
          "requiredPatches",
          "upgradeRequired"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "vulnerable",
              "secure",
              "eol",
              "unknown"
            ]
          },
          "requiredPatches": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Adobe isolated patches that name this exact release. They are not cumulative: all of them are needed, applied oldest first. When `upgradeRequired` is true, upgrade first and use the target release's own count. Null when no tracked bulletin covers the distribution. Bulletins are tracked from April 2024, so 0 on an end-of-support release does not mean it is safe.",
            "example": 4
          },
          "upgradeRequired": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "True when an open bulletin has no isolated patch for this exact release: the fix ships in a newer release, or Adobe only patches the newest release of the line. Null when no tracked bulletin covers the distribution.",
            "example": false
          }
        }
      },
      "MagentoVersionListItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MagentoVersion"
          },
          {
            "type": "object",
            "required": [
              "securitySummary"
            ],
            "properties": {
              "securitySummary": {
                "$ref": "#/components/schemas/ListSecuritySummary"
              }
            }
          }
        ]
      },
      "MagentoVersionWithSecurity": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MagentoVersion"
          },
          {
            "type": "object",
            "required": [
              "security"
            ],
            "properties": {
              "security": {
                "$ref": "#/components/schemas/VersionSecuritySummary"
              }
            }
          }
        ]
      },
      "VersionResponse": {
        "type": "object",
        "required": [
          "data",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/MagentoVersionWithSecurity"
          },
          "_documentation": {
            "type": "string",
            "format": "uri",
            "example": "https://magento.watch/api"
          },
          "_description": {
            "type": "string",
            "example": "Version 2.4.7-p3 details"
          }
        }
      },
      "Health": {
        "type": "object",
        "required": [
          "status",
          "timestamp",
          "distributions"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "ok"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "distributions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "magento-community",
                "magento-commerce",
                "mage-os"
              ]
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "const": "not found"
          }
        }
      },
      "SecurityCve": {
        "type": "object",
        "required": [
          "id",
          "cvss",
          "type",
          "impact",
          "authenticationRequired"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "CVE-2024-34102"
          },
          "cvss": {
            "type": [
              "number",
              "null"
            ],
            "example": 9.8
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "example": "improper-restriction-of-xml-external-entity-reference"
          },
          "impact": {
            "type": [
              "string",
              "null"
            ],
            "example": "arbitrary-code-execution"
          },
          "authenticationRequired": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "IsolatedPatch": {
        "type": "object",
        "required": [
          "id",
          "appliesTo",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "appliesTo": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "SecurityBulletin": {
        "type": "object",
        "required": [
          "id",
          "title",
          "summary",
          "publishedDate",
          "severity",
          "cves",
          "fixedIn",
          "isolatedPatches",
          "references"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "APSB24-40"
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string",
            "description": "Plain-text explanation of the flaw, the affected component and attacker impact"
          },
          "publishedDate": {
            "type": "string",
            "format": "date"
          },
          "severity": {
            "type": "string",
            "enum": [
              "critical",
              "important",
              "moderate"
            ]
          },
          "cves": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecurityCve"
            }
          },
          "fixedIn": {
            "type": "object",
            "description": "Distribution slug to first-patched version in each affected release line",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "isolatedPatches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IsolatedPatch"
            }
          },
          "references": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      },
      "SecurityBulletinsResponse": {
        "type": "object",
        "required": [
          "data",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "type": "object",
            "description": "Bulletin id to bulletin object",
            "additionalProperties": {
              "$ref": "#/components/schemas/SecurityBulletin"
            }
          },
          "_documentation": {
            "type": "string",
            "format": "uri",
            "example": "https://magento.watch/api"
          },
          "_description": {
            "type": "string"
          }
        }
      },
      "SecurityBulletinResponse": {
        "type": "object",
        "required": [
          "data",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SecurityBulletin"
          },
          "_documentation": {
            "type": "string",
            "format": "uri",
            "example": "https://magento.watch/api"
          },
          "_description": {
            "type": "string",
            "example": "Security bulletin APSB24-40 details"
          }
        }
      },
      "VersionSecurityBulletinRef": {
        "type": "object",
        "required": [
          "id",
          "severity",
          "publishedDate",
          "cves",
          "fixedIn"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "APSB24-40"
          },
          "severity": {
            "type": "string",
            "enum": [
              "critical",
              "important",
              "moderate"
            ]
          },
          "publishedDate": {
            "type": "string",
            "format": "date"
          },
          "cves": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fixedIn": {
            "type": [
              "string",
              "null"
            ],
            "example": "2.4.7-p1"
          },
          "isolatedPatches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IsolatedPatch"
            }
          }
        }
      },
      "VersionSecurityReport": {
        "type": "object",
        "required": [
          "distribution",
          "version",
          "status",
          "vulnerableTo",
          "fixedBy",
          "recommendedVersion"
        ],
        "properties": {
          "distribution": {
            "type": "string",
            "enum": [
              "magento-community",
              "magento-commerce",
              "mage-os"
            ]
          },
          "version": {
            "type": "string",
            "example": "2.4.7"
          },
          "status": {
            "type": "string",
            "enum": [
              "vulnerable",
              "secure",
              "eol",
              "unknown"
            ]
          },
          "vulnerableTo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersionSecurityBulletinRef"
            }
          },
          "fixedBy": {
            "type": "array",
            "description": "Bulletins already fixed in this release, shipped in it or inherited from an earlier patch of the line. Nothing to install.",
            "items": {
              "$ref": "#/components/schemas/VersionSecurityBulletinRef"
            }
          },
          "recommendedVersion": {
            "type": [
              "string",
              "null"
            ],
            "description": "Newest release of the same line, or this release when it is the newest. Not a verified safe target: it can have open bulletins of its own.",
            "example": "2.4.7-p10"
          }
        }
      },
      "VersionSecuritySummary": {
        "type": "object",
        "description": "VersionSecurityReport without the distribution and version fields, embedded on single-version responses",
        "required": [
          "status",
          "vulnerableTo",
          "fixedBy",
          "recommendedVersion"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "vulnerable",
              "secure",
              "eol",
              "unknown"
            ]
          },
          "vulnerableTo": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersionSecurityBulletinRef"
            }
          },
          "fixedBy": {
            "type": "array",
            "description": "Bulletins already fixed in this release, shipped in it or inherited from an earlier patch of the line. Nothing to install.",
            "items": {
              "$ref": "#/components/schemas/VersionSecurityBulletinRef"
            }
          },
          "recommendedVersion": {
            "type": [
              "string",
              "null"
            ],
            "description": "Newest release of the same line, or this release when it is the newest. Not a verified safe target: it can have open bulletins of its own.",
            "example": "2.4.7-p10"
          }
        }
      },
      "VersionSecurityResponse": {
        "type": "object",
        "required": [
          "data",
          "_documentation",
          "_description"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/VersionSecurityReport"
          },
          "_documentation": {
            "type": "string",
            "format": "uri",
            "example": "https://magento.watch/api"
          },
          "_description": {
            "type": "string",
            "example": "Security status for 2.4.7"
          }
        }
      }
    }
  }
}