{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openarchieven-nl/json-schema/openarchieven-nl-breakdown-response-schema.json",
  "title": "BreakdownResponse",
  "description": "Cross-tabulation result returned by `/stats/breakdown.json`. Records matching the supplied filters are aggregated on the dimension chosen by `group_by`.\n",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openarchieven-nl-openapi.yaml#/components/schemas/BreakdownResponse",
  "type": "object",
  "properties": {
    "group_by": {
      "type": "string",
      "enum": [
        "archive",
        "sourcetype",
        "eventtype",
        "place",
        "year"
      ],
      "description": "Dimension on which the results are grouped."
    },
    "filters": {
      "type": "object",
      "description": "Echoes the filter parameters supplied by the caller. Only filters actually present in the request are echoed; defaults are not.\n",
      "additionalProperties": true
    },
    "total_records": {
      "type": "integer",
      "description": "Total number of records matching the supplied filters."
    },
    "total_groups": {
      "type": "integer",
      "description": "Total distinct groups matching `min_count`. Capped at 750 (the SOLR_FACET_MAX limit). When this equals 750 the true number of groups may be higher.\n"
    },
    "results": {
      "type": "array",
      "description": "Top-N groups according to the chosen sort, truncated to `number_show`.",
      "items": {
        "$ref": "#/$defs/BreakdownGroup"
      }
    }
  },
  "required": [
    "group_by",
    "total_records",
    "total_groups",
    "results"
  ],
  "$defs": {
    "BreakdownGroup": {
      "type": "object",
      "description": "One group within a breakdown response.",
      "properties": {
        "key": {
          "type": "string",
          "description": "Raw facet value identifying the group. For `archive` this is the archive_code; for `sourcetype` and `eventtype` it is the Dutch raw value; for `place` it is the place name; for `year` it is the year as a string.\n"
        },
        "label": {
          "type": "string",
          "description": "Human-readable label, localised when `lang` is supplied. Only present for `archive`, `sourcetype` and `eventtype` groupings.\n"
        },
        "count": {
          "type": "integer",
          "description": "Number of records in this group after filters are applied."
        }
      },
      "required": [
        "key",
        "count"
      ]
    }
  }
}