{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/folio/json-schema/folio-central-server-agencies-dto-schema.json",
  "title": "centralServerAgenciesDTO",
  "description": "Agency collection from all configured central servers",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/folio-central-server-configuration-api-openapi.yml#/components/schemas/centralServerAgenciesDTO",
  "type": "object",
  "properties": {
    "totalRecords": {
      "type": "integer"
    },
    "centralServerAgencies": {
      "description": "List of agencies per central server",
      "type": "array",
      "items": {
        "$ref": "#/$defs/agenciesPerCentralServerDTO"
      }
    }
  },
  "required": [
    "centralServerAgencies"
  ],
  "additionalProperties": false,
  "$defs": {
    "agenciesPerCentralServerDTO": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Central server agencies",
      "type": "object",
      "properties": {
        "centralServerId": {
          "description": "Central server id",
          "type": "string",
          "format": "uuid"
        },
        "centralServerCode": {
          "description": "Central server code",
          "type": "string",
          "maxLength": 5
        },
        "agencies": {
          "description": "List of agencies for this central server",
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/$defs/agency"
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "centralServerId",
        "centralServerCode",
        "agencies"
      ]
    },
    "agency": {
      "$schema": "http://json-schema.org/draft-04/schema#",
      "description": "Agency details",
      "type": "object",
      "properties": {
        "agencyCode": {
          "description": "Agency code",
          "type": "string",
          "maxLength": 5
        },
        "description": {
          "description": "Agency description",
          "type": "string",
          "maxLength": 128
        }
      },
      "additionalProperties": false,
      "required": [
        "agencyCode",
        "description"
      ]
    }
  }
}