{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://retirementwealth.com.au/api/v2/schema/api.json",
  "title": "Retirement Wealth API v2",
  "description": "The files under /api/v2/. Each file's schema field points at one of the definitions here. Definitions shared with the registry (dimensions, applies_by, statement, exception, caveat, legal_basis, derivation, logic, id, date) are copied in from /api/v2/schema/registry.json when this file is published. See /data/ and docs/api.md.",
  "$defs": {
    "datetime": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
    },
    "url": {
      "type": "string",
      "pattern": "^https://"
    },
    "nullable_url": {
      "anyOf": [
        {
          "$ref": "#/$defs/url"
        },
        {
          "type": "null"
        }
      ]
    },
    "nullable_date": {
      "anyOf": [
        {
          "$ref": "#/$defs/date"
        },
        {
          "type": "null"
        }
      ]
    },
    "nullable_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "data_hash": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "source": {
      "type": "object",
      "required": [
        "title",
        "publisher",
        "url",
        "type"
      ],
      "additionalProperties": false,
      "properties": {
        "title": {
          "type": "string"
        },
        "publisher": {
          "type": "string"
        },
        "url": {
          "$ref": "#/$defs/url"
        },
        "type": {
          "enum": [
            "primary",
            "secondary"
          ]
        }
      }
    },
    "verification": {
      "type": "object",
      "required": [
        "status",
        "checked_on"
      ],
      "additionalProperties": false,
      "properties": {
        "status": {
          "enum": [
            "verified_primary",
            "secondary_only"
          ]
        },
        "checked_on": {
          "$ref": "#/$defs/date"
        }
      }
    },
    "unit": {
      "description": "A unit spelt out for software. ratio_divisor: divide a value by this to get a plain ratio. per_amount: the amount of assets a rate applies to.",
      "type": "object",
      "required": [
        "code",
        "plain",
        "quantity",
        "currency",
        "per",
        "per_amount",
        "ratio_divisor"
      ],
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "plain": {
          "type": "string"
        },
        "quantity": {
          "enum": [
            "money",
            "ratio",
            "time",
            "year"
          ]
        },
        "currency": {
          "anyOf": [
            {
              "const": "AUD"
            },
            {
              "type": "null"
            }
          ]
        },
        "per": {
          "anyOf": [
            {
              "enum": [
                "year",
                "fortnight",
                "day"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "per_amount": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "ratio_divisor": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "head": {
      "description": "Fields at the top of every file.",
      "type": "object",
      "required": [
        "api_version",
        "url",
        "schema",
        "docs",
        "publisher",
        "scope"
      ],
      "properties": {
        "api_version": {
          "const": "2.0"
        },
        "url": {
          "$ref": "#/$defs/url"
        },
        "schema": {
          "$ref": "#/$defs/url"
        },
        "docs": {
          "$ref": "#/$defs/url"
        },
        "publisher": {
          "type": "string"
        },
        "scope": {
          "type": "string"
        }
      }
    },
    "dataset_head": {
      "description": "Fields at the top of files that describe the whole data set. data_hash changes only when the published data changes.",
      "allOf": [
        {
          "$ref": "#/$defs/head"
        }
      ],
      "type": "object",
      "required": [
        "data_release",
        "data_hash",
        "data_updated"
      ],
      "properties": {
        "data_release": {
          "type": "integer",
          "minimum": 0
        },
        "data_hash": {
          "$ref": "#/$defs/data_hash"
        },
        "data_updated": {
          "anyOf": [
            {
              "$ref": "#/$defs/datetime"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "entry": {
      "description": "One value of a figure. effective_to is the day before the next value starts, or null. status: in_force, superseded, or legislated_not_yet_in_force (set by law for a later date).",
      "type": "object",
      "required": [
        "value",
        "display_value",
        "ratio",
        "effective_from",
        "effective_to",
        "basis",
        "status",
        "source",
        "verification",
        "notes",
        "url"
      ],
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number"
        },
        "display_value": {
          "type": "string"
        },
        "ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "effective_from": {
          "$ref": "#/$defs/nullable_date"
        },
        "effective_to": {
          "$ref": "#/$defs/nullable_date"
        },
        "basis": {
          "enum": [
            "value",
            "provision",
            "as_at"
          ]
        },
        "status": {
          "enum": [
            "in_force",
            "superseded",
            "legislated_not_yet_in_force"
          ]
        },
        "source": {
          "$ref": "#/$defs/source"
        },
        "verification": {
          "$ref": "#/$defs/verification"
        },
        "notes": {
          "$ref": "#/$defs/nullable_text"
        },
        "url": {
          "$ref": "#/$defs/nullable_url"
        }
      }
    },
    "release_ref": {
      "anyOf": [
        {
          "type": "object",
          "required": [
            "release",
            "recorded_at"
          ],
          "additionalProperties": false,
          "properties": {
            "release": {
              "type": "integer",
              "minimum": 1
            },
            "recorded_at": {
              "$ref": "#/$defs/datetime"
            }
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "figure": {
      "description": "A figure. timeline (every recorded value, newest first, values set by law for later dates first) is in each figure's own file only.",
      "type": "object",
      "required": [
        "id",
        "former_ids",
        "label",
        "category",
        "category_label",
        "concept",
        "kind",
        "dimensions",
        "value",
        "display_value",
        "unit",
        "ratio",
        "effective_from",
        "effective_from_basis",
        "validity",
        "applies_by",
        "resets",
        "review_dates",
        "source",
        "verification",
        "notes",
        "conditions",
        "exceptions",
        "caveats",
        "legal_basis",
        "derivation",
        "related",
        "upcoming",
        "first_published",
        "last_changed",
        "cite_as",
        "links"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "$ref": "#/$defs/id"
        },
        "former_ids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/id"
          }
        },
        "label": {
          "type": "string"
        },
        "category": {
          "$ref": "#/$defs/id"
        },
        "category_label": {
          "type": "string"
        },
        "concept": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "amount",
            "threshold",
            "cap",
            "rate",
            "taper",
            "factor",
            "age",
            "duration",
            "increment",
            "year"
          ]
        },
        "dimensions": {
          "anyOf": [
            {
              "$ref": "#/$defs/dimensions"
            },
            {
              "type": "object",
              "maxProperties": 0
            }
          ]
        },
        "value": {
          "type": "number"
        },
        "display_value": {
          "type": "string"
        },
        "unit": {
          "$ref": "#/$defs/unit"
        },
        "ratio": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ]
        },
        "effective_from": {
          "$ref": "#/$defs/nullable_date"
        },
        "effective_from_basis": {
          "enum": [
            "value",
            "provision",
            "as_at"
          ]
        },
        "validity": {
          "type": "object",
          "required": [
            "from",
            "to",
            "basis",
            "status"
          ],
          "additionalProperties": false,
          "properties": {
            "from": {
              "$ref": "#/$defs/nullable_date"
            },
            "to": {
              "$ref": "#/$defs/nullable_date"
            },
            "basis": {
              "enum": [
                "value",
                "provision",
                "as_at"
              ]
            },
            "status": {
              "const": "in_force"
            }
          }
        },
        "applies_by": {
          "anyOf": [
            {
              "$ref": "#/$defs/applies_by"
            },
            {
              "type": "null"
            }
          ]
        },
        "resets": {
          "type": "string"
        },
        "review_dates": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[0-9]{2}-[0-9]{2}$"
          }
        },
        "source": {
          "$ref": "#/$defs/source"
        },
        "verification": {
          "$ref": "#/$defs/verification"
        },
        "notes": {
          "$ref": "#/$defs/nullable_text"
        },
        "conditions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/statement"
          }
        },
        "exceptions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/exception"
          }
        },
        "caveats": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/caveat"
          }
        },
        "legal_basis": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/legal_basis"
          }
        },
        "derivation": {
          "anyOf": [
            {
              "$ref": "#/$defs/derivation"
            },
            {
              "type": "null"
            }
          ]
        },
        "related": {
          "type": "object",
          "required": [
            "same_concept",
            "inputs",
            "used_by"
          ],
          "additionalProperties": false,
          "properties": {
            "same_concept": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/id"
              }
            },
            "inputs": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/id"
              }
            },
            "used_by": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/id"
              }
            }
          }
        },
        "upcoming": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/entry"
          }
        },
        "first_published": {
          "$ref": "#/$defs/release_ref"
        },
        "last_changed": {
          "$ref": "#/$defs/release_ref"
        },
        "cite_as": {
          "type": "string"
        },
        "links": {
          "type": "object",
          "required": [
            "self",
            "page",
            "current_value"
          ],
          "additionalProperties": false,
          "properties": {
            "self": {
              "$ref": "#/$defs/url"
            },
            "page": {
              "$ref": "#/$defs/url"
            },
            "current_value": {
              "$ref": "#/$defs/nullable_url"
            }
          }
        },
        "timeline": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/entry"
          }
        }
      }
    },
    "api_index": {
      "allOf": [
        {
          "$ref": "#/$defs/dataset_head"
        }
      ],
      "type": "object",
      "required": [
        "name",
        "description",
        "endpoints",
        "openapi",
        "schemas",
        "atom",
        "llms_txt",
        "api_catalog"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "endpoints": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "path",
              "description"
            ],
            "additionalProperties": false,
            "properties": {
              "path": {
                "type": "string"
              },
              "url": {
                "$ref": "#/$defs/url"
              },
              "description": {
                "type": "string"
              },
              "schema": {
                "$ref": "#/$defs/url"
              },
              "content_type": {
                "type": "string"
              }
            }
          }
        },
        "openapi": {
          "$ref": "#/$defs/url"
        },
        "schemas": {
          "type": "object",
          "required": [
            "api",
            "registry"
          ],
          "additionalProperties": false,
          "properties": {
            "api": {
              "$ref": "#/$defs/url"
            },
            "registry": {
              "$ref": "#/$defs/url"
            }
          }
        },
        "atom": {
          "$ref": "#/$defs/url"
        },
        "llms_txt": {
          "$ref": "#/$defs/url"
        },
        "api_catalog": {
          "$ref": "#/$defs/url"
        }
      }
    },
    "figure_list": {
      "allOf": [
        {
          "$ref": "#/$defs/dataset_head"
        }
      ],
      "type": "object",
      "required": [
        "name",
        "last_verified",
        "oldest_verified",
        "count",
        "figures"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "last_verified": {
          "$ref": "#/$defs/date"
        },
        "oldest_verified": {
          "$ref": "#/$defs/date"
        },
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "figures": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/figure"
          }
        }
      }
    },
    "figure_file": {
      "allOf": [
        {
          "$ref": "#/$defs/head"
        }
      ],
      "type": "object",
      "required": [
        "figure"
      ],
      "properties": {
        "figure": {
          "allOf": [
            {
              "$ref": "#/$defs/figure"
            },
            {
              "type": "object",
              "required": [
                "timeline"
              ],
              "properties": {
                "timeline": {
                  "type": "array"
                }
              }
            }
          ]
        }
      }
    },
    "value_file": {
      "allOf": [
        {
          "$ref": "#/$defs/head"
        }
      ],
      "type": "object",
      "required": [
        "figure",
        "value"
      ],
      "properties": {
        "figure": {
          "type": "object",
          "required": [
            "id",
            "label",
            "concept",
            "kind",
            "dimensions",
            "unit",
            "url",
            "page"
          ],
          "additionalProperties": false,
          "properties": {
            "id": {
              "$ref": "#/$defs/id"
            },
            "label": {
              "type": "string"
            },
            "concept": {
              "type": "string"
            },
            "kind": {
              "type": "string"
            },
            "dimensions": {
              "type": "object"
            },
            "unit": {
              "type": "string"
            },
            "url": {
              "$ref": "#/$defs/url"
            },
            "page": {
              "$ref": "#/$defs/url"
            }
          }
        },
        "value": {
          "$ref": "#/$defs/entry"
        }
      }
    },
    "as_at_index": {
      "allOf": [
        {
          "$ref": "#/$defs/dataset_head"
        }
      ],
      "type": "object",
      "required": [
        "note",
        "count",
        "dates"
      ],
      "properties": {
        "note": {
          "type": "string"
        },
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "dates": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "date",
              "url",
              "figures_with_values"
            ],
            "additionalProperties": false,
            "properties": {
              "date": {
                "$ref": "#/$defs/date"
              },
              "url": {
                "$ref": "#/$defs/url"
              },
              "figures_with_values": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      }
    },
    "as_at_file": {
      "allOf": [
        {
          "$ref": "#/$defs/head"
        }
      ],
      "type": "object",
      "required": [
        "as_at",
        "count",
        "values",
        "not_recorded"
      ],
      "properties": {
        "as_at": {
          "$ref": "#/$defs/date"
        },
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "values": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "concept",
              "dimensions",
              "value",
              "display_value",
              "unit",
              "effective_from",
              "basis",
              "status",
              "url"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "$ref": "#/$defs/id"
              },
              "label": {
                "type": "string"
              },
              "concept": {
                "type": "string"
              },
              "dimensions": {
                "type": "object"
              },
              "value": {
                "type": "number"
              },
              "display_value": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "effective_from": {
                "$ref": "#/$defs/date"
              },
              "basis": {
                "enum": [
                  "value",
                  "provision",
                  "as_at"
                ]
              },
              "status": {
                "enum": [
                  "in_force",
                  "superseded",
                  "legislated_not_yet_in_force"
                ]
              },
              "url": {
                "$ref": "#/$defs/url"
              }
            }
          }
        },
        "not_recorded": {
          "description": "Figures with no recorded value on this date.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/id"
          }
        }
      }
    },
    "concept_list": {
      "allOf": [
        {
          "$ref": "#/$defs/dataset_head"
        }
      ],
      "type": "object",
      "required": [
        "count",
        "concepts"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "concepts": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "concept",
              "kind",
              "unit",
              "figures"
            ],
            "additionalProperties": false,
            "properties": {
              "concept": {
                "type": "string"
              },
              "kind": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "figures": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "label",
                    "dimensions",
                    "url"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "$ref": "#/$defs/id"
                    },
                    "label": {
                      "type": "string"
                    },
                    "dimensions": {
                      "type": "object"
                    },
                    "url": {
                      "$ref": "#/$defs/url"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "category_list": {
      "allOf": [
        {
          "$ref": "#/$defs/dataset_head"
        }
      ],
      "type": "object",
      "required": [
        "count",
        "categories"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "label",
              "description",
              "count",
              "figures",
              "page"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "$ref": "#/$defs/id"
              },
              "label": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "count": {
                "type": "integer",
                "minimum": 0
              },
              "figures": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/id"
                }
              },
              "page": {
                "$ref": "#/$defs/url"
              }
            }
          }
        }
      }
    },
    "unit_list": {
      "allOf": [
        {
          "$ref": "#/$defs/head"
        }
      ],
      "type": "object",
      "required": [
        "note",
        "units"
      ],
      "properties": {
        "note": {
          "type": "string"
        },
        "units": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/unit"
          }
        }
      }
    },
    "source_list": {
      "allOf": [
        {
          "$ref": "#/$defs/dataset_head"
        }
      ],
      "type": "object",
      "required": [
        "count",
        "sources"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "publisher",
              "url",
              "covers",
              "checked_on"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "publisher": {
                "type": "string"
              },
              "url": {
                "$ref": "#/$defs/url"
              },
              "covers": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/id"
                }
              },
              "checked_on": {
                "$ref": "#/$defs/date"
              }
            }
          }
        }
      }
    },
    "rule_list": {
      "allOf": [
        {
          "$ref": "#/$defs/dataset_head"
        }
      ],
      "type": "object",
      "required": [
        "count",
        "rules"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "rules": {
          "type": "array"
        }
      }
    },
    "event": {
      "description": "One change to the published data. recorded_at: when the change reached main, from which the site is built. effective_from: the date the value applies from, where there is one. Types: figure_added, figure_renamed, figure_removed, value_changed, correction, history_added, future_value_added, future_value_changed, future_value_removed, source_changed, verification_changed, rechecked, details_changed. preview: true only on preview builds, for changes not yet on main.",
      "type": "object",
      "required": [
        "id",
        "release",
        "recorded_at",
        "recorded_on",
        "type",
        "figure_id",
        "figure_id_then",
        "label",
        "category",
        "unit",
        "from",
        "to",
        "display_from",
        "display_to",
        "effective_from",
        "field",
        "fields",
        "former_id",
        "checked_on",
        "removed",
        "source",
        "figure",
        "preview"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^r[0-9]+\\.e[0-9]+$"
        },
        "release": {
          "type": "integer",
          "minimum": 1
        },
        "recorded_at": {
          "$ref": "#/$defs/datetime"
        },
        "recorded_on": {
          "$ref": "#/$defs/date"
        },
        "type": {
          "enum": [
            "figure_added",
            "figure_renamed",
            "figure_removed",
            "value_changed",
            "correction",
            "history_added",
            "future_value_added",
            "future_value_changed",
            "future_value_removed",
            "source_changed",
            "verification_changed",
            "rechecked",
            "details_changed"
          ]
        },
        "figure_id": {
          "$ref": "#/$defs/id"
        },
        "figure_id_then": {
          "anyOf": [
            {
              "$ref": "#/$defs/id"
            },
            {
              "type": "null"
            }
          ]
        },
        "label": {
          "type": "string"
        },
        "category": {
          "type": "string"
        },
        "unit": {
          "type": "string"
        },
        "from": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "to": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "display_from": {
          "$ref": "#/$defs/nullable_text"
        },
        "display_to": {
          "$ref": "#/$defs/nullable_text"
        },
        "effective_from": {
          "$ref": "#/$defs/nullable_date"
        },
        "field": {
          "$ref": "#/$defs/nullable_text"
        },
        "fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "former_id": {
          "anyOf": [
            {
              "$ref": "#/$defs/id"
            },
            {
              "type": "null"
            }
          ]
        },
        "checked_on": {
          "$ref": "#/$defs/nullable_date"
        },
        "removed": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "value",
              "effective_from"
            ],
            "additionalProperties": false,
            "properties": {
              "value": {
                "type": "number"
              },
              "effective_from": {
                "$ref": "#/$defs/nullable_date"
              }
            }
          }
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/source"
            },
            {
              "type": "null"
            }
          ]
        },
        "figure": {
          "$ref": "#/$defs/nullable_url"
        },
        "preview": {
          "type": "boolean"
        }
      }
    },
    "change_list": {
      "allOf": [
        {
          "$ref": "#/$defs/dataset_head"
        }
      ],
      "type": "object",
      "required": [
        "count",
        "events"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/event"
          }
        }
      }
    },
    "release_summary": {
      "type": "object",
      "required": [
        "release",
        "recorded_at",
        "recorded_on",
        "data_hash",
        "event_count",
        "counts",
        "url",
        "preview"
      ],
      "additionalProperties": false,
      "properties": {
        "release": {
          "type": "integer",
          "minimum": 1
        },
        "recorded_at": {
          "$ref": "#/$defs/datetime"
        },
        "recorded_on": {
          "$ref": "#/$defs/date"
        },
        "data_hash": {
          "$ref": "#/$defs/data_hash"
        },
        "event_count": {
          "type": "integer",
          "minimum": 0
        },
        "counts": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": 1
          }
        },
        "url": {
          "$ref": "#/$defs/url"
        },
        "preview": {
          "type": "boolean"
        }
      }
    },
    "release_list": {
      "allOf": [
        {
          "$ref": "#/$defs/dataset_head"
        }
      ],
      "type": "object",
      "required": [
        "count",
        "releases"
      ],
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0
        },
        "releases": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/release_summary"
          }
        }
      }
    },
    "release_file": {
      "allOf": [
        {
          "$ref": "#/$defs/head"
        }
      ],
      "type": "object",
      "required": [
        "release",
        "recorded_at",
        "recorded_on",
        "data_hash",
        "event_count",
        "counts",
        "url",
        "preview",
        "events"
      ],
      "properties": {
        "release": {
          "type": "integer",
          "minimum": 1
        },
        "recorded_at": {
          "$ref": "#/$defs/datetime"
        },
        "recorded_on": {
          "$ref": "#/$defs/date"
        },
        "data_hash": {
          "$ref": "#/$defs/data_hash"
        },
        "event_count": {
          "type": "integer",
          "minimum": 0
        },
        "counts": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": 1
          }
        },
        "url": {
          "$ref": "#/$defs/url"
        },
        "preview": {
          "type": "boolean"
        },
        "events": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/event"
          }
        }
      }
    },
    "latest_release": {
      "allOf": [
        {
          "$ref": "#/$defs/head"
        }
      ],
      "type": "object",
      "required": [
        "data_hash",
        "release",
        "changes"
      ],
      "properties": {
        "data_hash": {
          "$ref": "#/$defs/data_hash"
        },
        "release": {
          "anyOf": [
            {
              "$ref": "#/$defs/release_summary"
            },
            {
              "type": "null"
            }
          ]
        },
        "changes": {
          "$ref": "#/$defs/url"
        }
      }
    },
    "id": {
      "description": "A permanent identifier in snake_case. Never reused or changed once published; a figure that must be renamed keeps its old id in former_ids.",
      "type": "string",
      "pattern": "^[a-z0-9]+(_[a-z0-9]+)*$"
    },
    "date": {
      "description": "A calendar date, YYYY-MM-DD.",
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
    },
    "text": {
      "type": "string",
      "minLength": 1
    },
    "dimensions": {
      "description": "What tells this figure apart from the other figures with the same concept.",
      "type": "object",
      "additionalProperties": false,
      "minProperties": 1,
      "properties": {
        "household": {
          "description": "single; couple; couple_illness_separated (a couple living apart because of illness); couple_separated (a couple living apart because of illness, respite care or prison, as the Commonwealth Seniors Health Card income test describes it).",
          "enum": [
            "single",
            "couple",
            "couple_illness_separated",
            "couple_separated"
          ]
        },
        "basis": {
          "description": "For couples: combined (both partners together) or each (for each partner).",
          "enum": [
            "combined",
            "each"
          ]
        },
        "homeowner": {
          "type": "boolean"
        },
        "age_band": {
          "description": "Ages in whole years, inclusive. null means no lower or no upper limit.",
          "type": "object",
          "required": [
            "min",
            "max"
          ],
          "additionalProperties": false,
          "properties": {
            "min": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            },
            "max": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "tier": {
          "description": "The position of a threshold in a numbered series: 1 for the first threshold.",
          "type": "integer",
          "minimum": 1
        },
        "cohort": {
          "description": "The group of people a figure applies to, as the source names it.",
          "enum": [
            "fee_arrangements_2014_07_01",
            "fee_arrangements_2025_11_01",
            "first_entered_residential_care_from_2025_11_01"
          ]
        },
        "service_category": {
          "enum": [
            "clinical",
            "independence",
            "everyday_living"
          ]
        },
        "means_status": {
          "enum": [
            "full_pensioner",
            "not_eligible_for_pension_or_cshc"
          ]
        },
        "bring_forward_period_years": {
          "enum": [
            2,
            3
          ]
        },
        "balance_threshold": {
          "description": "Division 296: large or very large super balance threshold.",
          "enum": [
            "large",
            "very_large"
          ]
        },
        "deeming_band": {
          "enum": [
            "lower",
            "upper"
          ]
        }
      }
    },
    "applies_by": {
      "description": "Which value applies, when that is not simply the value in force on the date in question. text is copied from the figure's notes.",
      "type": "object",
      "required": [
        "selector",
        "text"
      ],
      "additionalProperties": false,
      "properties": {
        "selector": {
          "description": "date_of_birth: the value depends on the person's date of birth. financial_year: the value for the financial year, measured as the text says. event_date: the value in force on the date of an event, such as when a contribution is made. fixed_at_event: the value in force at an event stays fixed for that person.",
          "enum": [
            "date_of_birth",
            "financial_year",
            "event_date",
            "fixed_at_event"
          ]
        },
        "text": {
          "$ref": "#/$defs/text"
        }
      }
    },
    "statement": {
      "description": "A sentence copied word for word from the figure's notes.",
      "type": "object",
      "required": [
        "text"
      ],
      "additionalProperties": false,
      "properties": {
        "text": {
          "$ref": "#/$defs/text"
        }
      }
    },
    "exception": {
      "description": "A case where the figure differs or does not apply, copied word for word from the figure's notes. modelled is false while no rule module in this registry covers the case.",
      "type": "object",
      "required": [
        "text",
        "modelled"
      ],
      "additionalProperties": false,
      "properties": {
        "text": {
          "$ref": "#/$defs/text"
        },
        "modelled": {
          "type": "boolean"
        }
      }
    },
    "caveat": {
      "description": "Something to know about the source of the figure, copied word for word from its notes.",
      "type": "object",
      "required": [
        "type",
        "text"
      ],
      "additionalProperties": false,
      "properties": {
        "type": {
          "description": "source_conflict: two official sources differ. indicative_source: the source describes its own figures as indicative. use_not_stated: the source does not say how the figure is used. source_scope: the figure is stated on a related page. derived_effective_date: the effective date is worked out, not stated.",
          "enum": [
            "source_conflict",
            "indicative_source",
            "use_not_stated",
            "source_scope",
            "derived_effective_date"
          ]
        },
        "text": {
          "$ref": "#/$defs/text"
        }
      }
    },
    "legal_basis": {
      "description": "A law the figure's notes or source cite. role: sets_value (the provision that sets the figure), indexation (the provision that indexes it) or effective_date (the law the effective date comes from).",
      "type": "object",
      "required": [
        "instrument",
        "role"
      ],
      "additionalProperties": false,
      "properties": {
        "instrument": {
          "$ref": "#/$defs/text"
        },
        "provision": {
          "$ref": "#/$defs/text"
        },
        "role": {
          "enum": [
            "sets_value",
            "indexation",
            "effective_date"
          ]
        }
      }
    },
    "derivation": {
      "description": "How the value can be worked out from other figures. Each variable takes the input figure's value in its own unit (for example 12 for 12%). The validator checks the published value against this calculation. basis: stated (the figure's notes, or the source given here, describe the calculation), implied (it follows from the inputs' own rules, with no rounding) or observed (it matches the published values; the calculation is not taken from an official source).",
      "type": "object",
      "required": [
        "expression",
        "inputs",
        "basis",
        "description"
      ],
      "additionalProperties": false,
      "properties": {
        "expression": {
          "$ref": "#/$defs/logic"
        },
        "inputs": {
          "type": "object",
          "minProperties": 1,
          "additionalProperties": {
            "$ref": "#/$defs/id"
          }
        },
        "basis": {
          "enum": [
            "stated",
            "implied",
            "observed"
          ]
        },
        "valid_from": {
          "$ref": "#/$defs/date"
        },
        "description": {
          "$ref": "#/$defs/text"
        },
        "source": {
          "$ref": "#/$defs/source"
        }
      }
    },
    "logic": {
      "description": "A JSON Logic expression. Supported operations: var, +, -, *, /, min, max, round_up_to, round_down_to. round_up_to and round_down_to take [number, multiple].",
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "object"
        }
      ]
    }
  }
}
