{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adanos-market-sentiment-api/json-schema/adanos-market-sentiment-api-health-response-schema.json",
  "title": "HealthResponse",
  "description": "API health status.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adanos-market-sentiment-api-health-check-api-openapi.yml#/components/schemas/HealthResponse",
  "properties": {
    "status": {
      "type": "string",
      "title": "Status",
      "description": "Current health status"
    },
    "service": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Service",
      "description": "Service identifier"
    },
    "version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Version",
      "description": "Service version"
    },
    "total_mentions": {
      "type": "integer",
      "title": "Total Mentions",
      "description": "Mentions observed in the most recent scrape cycle; returns 0 when scrape telemetry is unavailable.",
      "default": 0
    },
    "tickers_tracked": {
      "type": "integer",
      "title": "Tickers Tracked",
      "description": "Distinct tickers observed in the most recent scrape cycle; returns 0 when scrape telemetry is unavailable.",
      "default": 0
    },
    "scheduler": {
      "anyOf": [
        {
          "$ref": "#/$defs/SchedulerStatus"
        },
        {
          "type": "null"
        }
      ],
      "description": "Scheduler status information"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error",
      "description": "Error message if unhealthy"
    }
  },
  "type": "object",
  "required": [
    "status"
  ],
  "$defs": {
    "SchedulerStatus": {
      "properties": {
        "running": {
          "type": "boolean",
          "title": "Running",
          "description": "Whether worker is alive (based on heartbeat freshness)"
        },
        "last_scrape": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Scrape",
          "description": "ISO timestamp of last scrape (null if never run)"
        },
        "scrape_count": {
          "type": "integer",
          "title": "Scrape Count",
          "description": "Total number of scrapes performed",
          "default": 0
        },
        "error_count": {
          "type": "integer",
          "title": "Error Count",
          "description": "Total number of scrape errors/failures",
          "default": 0
        },
        "success_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Success Rate",
          "description": "Scrape success rate (0.0-1.0)"
        },
        "note": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Note",
          "description": "Additional info (e.g., worker heartbeat status)"
        }
      },
      "type": "object",
      "required": [
        "running"
      ],
      "title": "SchedulerStatus",
      "description": "Scheduler status information."
    }
  }
}