{
  "openapi": "3.1.0",
  "info": {
    "title": "SonarCloud Public API",
    "version": "1.0.0",
    "description": "Machine-readable surface for the SonarCloud marketing site and product directory. School dashboard operations stay on dashboard.getsonarcloud.com after a human books access.",
    "contact": {
      "name": "SonarCloud",
      "email": "info@getsonarcloud.com",
      "url": "https://getsonarcloud.com/"
    },
    "license": {
      "name": "All rights reserved",
      "url": "https://getsonarcloud.com/terms.html"
    }
  },
  "servers": [
    {
      "url": "https://getsonarcloud.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Liveness check",
        "tags": ["Meta"],
        "responses": {
          "200": {
            "description": "Service is reachable",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Health" }
              }
            }
          },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    },
    "/api/v1/site": {
      "get": {
        "operationId": "getSite",
        "summary": "Public site directory",
        "tags": ["Meta"],
        "responses": {
          "200": {
            "description": "Canonical links, contact, and product summary",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Site" }
              }
            }
          },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Health": {
        "type": "object",
        "required": ["status", "service", "docs"],
        "properties": {
          "status": { "type": "string", "const": "ok" },
          "service": { "type": "string" },
          "docs": { "type": "string", "format": "uri" }
        }
      },
      "Site": {
        "type": "object",
        "required": ["name", "url", "description", "contact", "links"],
        "properties": {
          "name": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "description": { "type": "string" },
          "contact": {
            "type": "object",
            "required": ["email", "contactType"],
            "properties": {
              "email": { "type": "string", "format": "email" },
              "contactType": { "type": "string" },
              "url": { "type": "string", "format": "uri" }
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": { "type": "string", "format": "uri" }
          }
        }
      },
      "ApiError": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message", "hint"],
            "properties": {
              "code": { "type": "string" },
              "message": { "type": "string" },
              "hint": { "type": "string" }
            }
          }
        }
      }
    },
    "responses": {
      "MethodNotAllowed": {
        "description": "Use GET",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/ApiError" }
          }
        }
      },
      "NotFound": {
        "description": "No endpoint at this path",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/ApiError" }
          }
        }
      }
    }
  }
}
