{
  "openapi": "3.1.0",
  "info": {
    "title": "ProductWatch Compatibility Registry API",
    "version": "1.0.0",
    "description": "Resolve a free-text product string to canonical models and their compatibility attributes."
  },
  "servers": [
    {
      "url": "/api/public/v1"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    }
  },
  "paths": {
    "/datasets": {
      "get": {
        "summary": "List available datasets and their attribute schemas",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/{dataset}/search": {
      "get": {
        "summary": "Ranked fuzzy search for models matching a free-text query",
        "parameters": [
          {
            "name": "dataset",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "watches"
          },
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "does this fit a fenix 7 pro?"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked candidates"
          },
          "401": {
            "description": "Missing or invalid API key"
          }
        }
      }
    },
    "/{dataset}/models/{slug}": {
      "get": {
        "summary": "Full record for one model, including aliases and fitment rows",
        "parameters": [
          {
            "name": "dataset",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    }
  }
}