{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/signdocs-com-br/json-schema/signdocs-com-br-health-response-schema.json",
  "title": "HealthResponse",
  "description": "Resposta de verificação de saúde da API.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/signdocs-com-br-health-api-openapi.yml#/components/schemas/HealthResponse",
  "type": "object",
  "required": [
    "status",
    "timestamp",
    "service",
    "components",
    "latencyMs"
  ],
  "properties": {
    "status": {
      "type": "string",
      "description": "Status geral da API.",
      "enum": [
        "healthy",
        "unhealthy"
      ]
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "service": {
      "type": "string",
      "description": "Nome do serviço."
    },
    "components": {
      "type": "object",
      "description": "Status individual de cada componente.",
      "properties": {
        "dynamodb": {
          "$ref": "#/$defs/ComponentHealth"
        },
        "s3": {
          "$ref": "#/$defs/ComponentHealth"
        },
        "kms": {
          "$ref": "#/$defs/ComponentHealth"
        },
        "mtlsTruststore": {
          "$ref": "#/$defs/ComponentHealth"
        }
      }
    },
    "latencyMs": {
      "type": "number",
      "description": "Latência total da verificação em milissegundos."
    }
  },
  "$defs": {
    "ComponentHealth": {
      "type": "object",
      "description": "Status de saúde de um componente individual.",
      "required": [
        "status",
        "latencyMs"
      ],
      "properties": {
        "status": {
          "type": "string",
          "description": "Status operacional do componente.",
          "enum": [
            "operational",
            "down"
          ]
        },
        "latencyMs": {
          "type": "number",
          "description": "Latência da verificação do componente em milissegundos."
        }
      }
    }
  }
}