{
  "$schema": "https://json-schema.org/draft/2020-12",
  "$id": "https://spring.io/schemas/actuator-health",
  "title": "Spring Boot Actuator Health Response",
  "description": "JSON Schema for the Spring Boot Actuator health endpoint response",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Overall health status of the application",
      "enum": ["UP", "DOWN", "OUT_OF_SERVICE", "UNKNOWN"],
      "example": "UP"
    },
    "components": {
      "type": "object",
      "description": "Health status details per registered health indicator",
      "additionalProperties": {
        "$ref": "#/$defs/ComponentHealth"
      },
      "example": {
        "db": {
          "status": "UP",
          "details": {
            "database": "PostgreSQL",
            "validationQuery": "isValid()"
          }
        },
        "diskSpace": {
          "status": "UP",
          "details": {
            "total": 499963174912,
            "free": 250981711872,
            "threshold": 10485760,
            "path": "/"
          }
        }
      }
    }
  },
  "required": ["status"],
  "$defs": {
    "ComponentHealth": {
      "type": "object",
      "description": "Health indicator component status",
      "properties": {
        "status": {
          "type": "string",
          "enum": ["UP", "DOWN", "OUT_OF_SERVICE", "UNKNOWN"]
        },
        "details": {
          "type": "object",
          "description": "Component-specific health details",
          "additionalProperties": true
        },
        "components": {
          "type": "object",
          "description": "Nested component health (for composite indicators)",
          "additionalProperties": {
            "$ref": "#/$defs/ComponentHealth"
          }
        }
      },
      "required": ["status"]
    }
  }
}
