{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vaheroesph-com/json-schema/vaheroesph-com-health-schema.json",
  "title": "Health",
  "description": "API liveness information. With ?ready=true the response also reports readiness of the API and its database dependency, as booleans and status words only — never infrastructure details.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vaheroesph-com-openapi.json#/components/schemas/Health",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "degraded"
      ],
      "description": "\"ok\" when the service is healthy, \"degraded\" when a dependency is unavailable."
    },
    "service": {
      "type": "string",
      "description": "Service identifier."
    },
    "version": {
      "type": "string",
      "description": "API version identifier."
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Server time of the response."
    },
    "ready": {
      "type": "boolean",
      "description": "Readiness result. Present only on the readiness probe."
    },
    "checks": {
      "type": "object",
      "description": "Dependency results. Present only on the readiness probe.",
      "properties": {
        "api": {
          "type": "string",
          "enum": [
            "ok"
          ],
          "description": "Request pipeline is serving."
        },
        "database": {
          "type": "string",
          "enum": [
            "ok",
            "unavailable"
          ],
          "description": "Database reachability. No hostnames, credentials or error details."
        },
        "databaseLatencyMs": {
          "type": "integer",
          "minimum": 0,
          "description": "Round-trip duration of the database probe."
        }
      },
      "required": [
        "api",
        "database"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "status",
    "version",
    "timestamp"
  ],
  "additionalProperties": false
}