{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/thegoldbarometer-com/json-schema/thegoldbarometer-com-latest-schema.json",
  "title": "Latest",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/thegoldbarometer-com-openapi.yaml#/components/schemas/Latest",
  "type": "object",
  "required": [
    "date",
    "score",
    "zone",
    "version"
  ],
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Trading day the reading describes."
    },
    "score": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "The reading, rounded."
    },
    "score_precise": {
      "type": "number",
      "description": "The reading before rounding."
    },
    "zone": {
      "type": "string",
      "enum": [
        "Historically very unfavorable",
        "Unfavorable",
        "Mixed",
        "Favorable",
        "Historically very favorable"
      ],
      "description": "Zone the score falls in. Bands are 0-19, 20-39, 40-59, 60-79, 80-100."
    },
    "version": {
      "type": "string",
      "description": "Methodology version."
    },
    "engine_build": {
      "type": "string",
      "description": "Build date of the engine that computed this reading."
    },
    "api_version": {
      "type": "integer"
    },
    "pillars_used": {
      "type": "integer",
      "description": "How many of the seven parts had usable data."
    },
    "pillars_total": {
      "type": "integer"
    },
    "weights_nominal": {
      "type": "object",
      "additionalProperties": {
        "type": "number"
      },
      "description": "Design weight of each part, in points."
    },
    "weights_effective": {
      "type": "object",
      "additionalProperties": {
        "type": "number"
      },
      "description": "Weight actually applied after unavailable parts are dropped."
    },
    "about": {
      "type": "object",
      "description": "Who publishes the reading, under which licence, and how to credit it.",
      "properties": {
        "publisher": {
          "type": "string"
        },
        "site": {
          "type": "string",
          "format": "uri"
        },
        "methodology": {
          "type": "string",
          "format": "uri"
        },
        "license": {
          "type": "string"
        },
        "credit": {
          "type": "string"
        }
      }
    },
    "alerts": {
      "type": "object",
      "description": "The free zone-change email. One message each time the reading moves to a new zone.",
      "properties": {
        "what": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "pillars": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/Pillar"
      },
      "description": "State of each part, keyed by part name."
    },
    "computed_at_utc": {
      "type": "string"
    }
  },
  "additionalProperties": true,
  "$defs": {
    "Pillar": {
      "type": "object",
      "required": [
        "name",
        "available"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "available": {
          "type": "boolean",
          "description": "False when the part had no usable data and was dropped for the day."
        },
        "subscore": {
          "type": "number",
          "description": "The part's own 0-100 reading. Absent when unavailable."
        },
        "latest_date": {
          "type": "string",
          "format": "date",
          "description": "Date of the newest source figure."
        },
        "latest_value": {
          "type": [
            "number",
            "null"
          ],
          "description": "The newest raw figure, when the source licence allows publishing it."
        },
        "unit": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "frequency": {
          "type": "string"
        },
        "staleness_days": {
          "type": "integer"
        },
        "stale_limit_days": {
          "type": "integer"
        },
        "history_points": {
          "type": "integer"
        },
        "publishable_raw": {
          "type": "boolean"
        },
        "weight_nominal": {
          "type": "number"
        },
        "weight_effective": {
          "type": "number"
        },
        "staleness_flag": {
          "type": "string"
        }
      },
      "additionalProperties": true
    }
  }
}